<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5199087724247829980</id><updated>2012-02-16T06:01:17.458-08:00</updated><category term='web application'/><category term='DTD'/><category term='CopyTo()'/><category term='List all the files in a directory on a web form in asp.net'/><category term='Remove'/><category term='onRemoveCallback'/><category term='loginUrl'/><category term='advantages of using LINQ or Language INtegrated Query'/><category term='web application Security'/><category term='HTTPS'/><category term='Difference between EnableViewState and ViewStateMode properties'/><category term='link element'/><category term='UTF'/><category term='stylesheet'/><category term='what is LINQ'/><category term='empty XML element'/><category term='What are XML namespaces'/><category term='total number of elements in an array'/><category term='well-formed XML documents'/><category term='Interview Questions'/><category term='Techniques'/><category term='How is the DLL HELL problem solved in .NET'/><category term='When do you use Setter Injection over Constructor Injection'/><category term='Length'/><category term='ASP.NET'/><category term='HTTP'/><category term='When to use namespaces'/><category term='VaryByParam'/><category term='deployed'/><category term='location'/><category term='selectedindex'/><category term='difference between asynchronous and synchronous HTTP Handlers'/><category term='strong naming an assembly'/><category term='Written Test'/><category term='response.redirect'/><category term='copy one array into another array'/><category term='Unmanaged Code'/><category term='advantages and disadvantages of a layered architecture'/><category term='absoluteExpiration'/><category term='cssclass'/><category term='real time interview question'/><category term='Events'/><category term='Forms'/><category term='Insert'/><category term='Dependency Injection with an example'/><category term='outputcache'/><category term='MNC&apos;s'/><category term='global theme'/><category term='XML Schema'/><category term='web garden'/><category term='reverse'/><category term='protection'/><category term='difference'/><category term='htmlencode'/><category term='generate a strong name'/><category term='User controls'/><category term='CacheDependency'/><category term='default skin'/><category term='CSS'/><category term='ASP.NET Exception Handling'/><category term='authentication'/><category term='attribute'/><category term='XML attributes'/><category term='Detect and redirect'/><category term='advantages'/><category term='FormsAuthentication'/><category term='Secure Socket Layer'/><category term='What is Globalization'/><category term='Add'/><category term='Page navigation techniques'/><category term='style builder'/><category term='duration'/><category term='directory explorer'/><category term='difference between an XML schema and a DTD'/><category term='XML'/><category term='base class'/><category term='What is a theme'/><category term='custom controls'/><category term='state'/><category term='CacheItemPriority'/><category term='HTTP Handler'/><category term='What Dependency Injection Container have you used in your project'/><category term='varybycontrol'/><category term='stringbuilder'/><category term='classname'/><category term='difference between layers and tiers'/><category term='SQL Injection Attack with an example'/><category term='Application build'/><category term='ASP.NET Interview Questions'/><category term='3 different types of arrays'/><category term='reference a style sheet'/><category term='DataSet.Copy'/><category term='Reusable SQL function to split a string'/><category term='ViewState'/><category term='DataSet.CaseSensitive'/><category term='Cookies'/><category term='secure connection strings'/><category term='Managed Code'/><category term='write a custom reusable function to populate a dropdownlist'/><category term='related'/><category term='difference between const and static read-only member'/><category term='Dot Net Videos'/><category term='Document Type Definition'/><category term='windows authentication'/><category term='Basic'/><category term='DataSet.RejectChanges'/><category term='AcceptChanges'/><category term='string manipulation'/><category term='send data'/><category term='2 types of XML parsers'/><category term='web farm'/><category term='Cache'/><category term='ASP.NET Page is very slow. What will you do to make it fast'/><category term='weak'/><category term='neutral cultures'/><category term='trace'/><category term='HTTP module'/><category term='Best pactices in developing asp.net applications'/><category term='sql injection'/><category term='assembly'/><category term='globalizing web applications'/><category term='Session State'/><category term='string'/><category term='web.config is empty'/><category term='Data Access Security'/><category term='Constructor'/><category term='frequently asked'/><category term='custom HTTP handler factory'/><category term='DataSet.Clone'/><category term='well formed XML documents'/><category term='selecteditem'/><category term='DataSet'/><category term='strong'/><category term='partialcaching'/><category term='Run-time adjustment'/><category term='constarints and relations on tables inside a DataSet'/><category term='setter'/><category term='class'/><category term='FileInfo'/><category term='Reading and writing to an XML file'/><category term='Master Pages'/><category term='SSL'/><category term='folders'/><category term='code'/><category term='slidingExpiration'/><category term='.exe'/><category term='HttpCachePolicy'/><category term='elementid'/><category term='differences'/><category term='fragment'/><category term='named'/><category term='assemblies'/><category term='script injection'/><category term='Named skin'/><category term='difference between themes and CSS'/><category term='IHttpAsyncHandler'/><category term='advantages of using Dependency Injection'/><category term='sample programs'/><category term='CacheItemRemoved'/><category term='troubleshoot performance issue'/><category term='Server.transfer'/><category term='Query Strings'/><category term='combine both Schema and DTD'/><category term='based'/><category term='arrays in C# value types or reference types'/><category term='Tracing'/><category term='inline formatting'/><category term='ADO.NET'/><category term='Transactions'/><category term='IHttpHandler'/><category term='ASP.NET controls'/><category term='Application State'/><category term='XML document declaration'/><category term='shared'/><category term='DataSet.HasChanges'/><category term='Linq Interview Questions'/><category term='Passport Authentication'/><category term='DirectoryInfo'/><category term='Bind an XML file to a dropdownlist'/><category term='Write and Read a cookie'/><category term='cascading style sheets'/><category term='caching'/><category term='timeout'/><category term='sort an array'/><category term='practical ASP.NET Interview Questions'/><category term='different ways to globalize web applications'/><category term='What is DLL HELL in .NET'/><category term='Validation controls'/><title type='text'>asp.net interview questions</title><subtitle type='html'>asp.net interview questions</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>68</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-4936906073869413958</id><published>2011-12-12T11:53:00.000-08:00</published><updated>2011-12-12T11:57:06.801-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web.config is empty'/><title type='text'>When I create a new ASP.NET 4 web application, the web.config file is almost empty. What happened to all the configuration elements that were there prior to ASP.NET 4?</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;All the major configuration settings are moved into machine.config file, and all the applications will inherit the setting from this file. If an application needs to override the default settings, we can do so using the application specific configuration (web.config) file. ASP.NET 4 applications have clean web.config files.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;If you create a new asp.net 4 empty web application, the only entry that you will find is shown below&lt;/b&gt;.&lt;/span&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;img border="1" src="http://3.bp.blogspot.com/-kzsxToiqfgM/TuZa0JXwc3I/AAAAAAAAAI0/piFQvPYFTVU/s1600/CleanWebConfig.png" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Note:&lt;/b&gt; If you create a &lt;b&gt;&lt;span class="Apple-style-span" style="color: #0b5394;"&gt;new ASP.NET Web Application&lt;/span&gt;&lt;/b&gt;, instead of a &lt;b&gt;new ASP.NET &lt;span class="Apple-style-span" style="color: red;"&gt;Empty &lt;/span&gt;Web Application&lt;/b&gt;, you will find a lot more confiuration entries in the web.config file. This is because, the template for ASP.NET web application overrides some of the default settings inherited from machine.config.&lt;/span&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-4936906073869413958?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/4936906073869413958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2011/12/when-i-create-new-aspnet-4-web.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/4936906073869413958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/4936906073869413958'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2011/12/when-i-create-new-aspnet-4-web.html' title='When I create a new ASP.NET 4 web application, the web.config file is almost empty. What happened to all the configuration elements that were there prior to ASP.NET 4?'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-kzsxToiqfgM/TuZa0JXwc3I/AAAAAAAAAI0/piFQvPYFTVU/s72-c/CleanWebConfig.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-4234583377685872079</id><published>2011-12-09T10:21:00.000-08:00</published><updated>2011-12-09T10:23:15.472-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Difference between EnableViewState and ViewStateMode properties'/><title type='text'>Difference between EnableViewState and ViewStateMode properties</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;1. Using &lt;b&gt;EnableViewState&lt;/b&gt; property we only have 2 options&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;We can turn off view state altogether,&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;or&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Enable viewstate for the entire page and then turn it off on a control-by-control basis.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;2. If you want to turn of &lt;b&gt;ViewState&lt;/b&gt; for the entire page and only enable it for specific controls on the page, then we have to use &lt;b&gt;ViewStateMode&lt;/b&gt; property in conjunction with &lt;b&gt;EnableViewState&lt;/b&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;3. &lt;b&gt;EnableViewState&lt;/b&gt; property only accepts true or false values and the default value is true, where as &lt;b&gt;ViewStateMode&lt;/b&gt; property can have a value of - Enabled, Disabled and inherit. Inherit is the default value for &lt;b&gt;ViewStateMode&lt;/b&gt; property.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;4. &lt;b&gt;ViewStateMode&lt;/b&gt; property is introduced in ASP.NET 4, where as &lt;b&gt;EnableViewState&lt;/b&gt; exists from a long time.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;5. If &lt;b&gt;EnableViewState&lt;/b&gt; is to True, only then the &lt;b&gt;ViewStateMode&lt;/b&gt; settings are applied, where as, if &lt;b&gt;EnableViewState&lt;/b&gt; is set to False then the control will not save its view state, regardless of the &lt;b&gt;ViewStateMode&lt;/b&gt; setting. In short if &lt;b&gt;EnableViewState&lt;/b&gt; is set to False, &lt;b&gt;ViewStateMode&lt;/b&gt; setting is not respected.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;6. To disable view state for a page and to enable it for a specific control on the page, set the &lt;b&gt;EnableViewState&lt;/b&gt; property of the page and the control to true, set the &lt;b&gt;ViewStateMode&lt;/b&gt; property of the page to Disabled, and set the &lt;b&gt;ViewStateMode&lt;/b&gt; property of the control to Enabled.&lt;/span&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-4234583377685872079?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/4234583377685872079/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2011/12/difference-between-enableviewstate-and.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/4234583377685872079'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/4234583377685872079'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2011/12/difference-between-enableviewstate-and.html' title='Difference between EnableViewState and ViewStateMode properties'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-3604780015559393919</id><published>2011-11-28T13:52:00.000-08:00</published><updated>2011-12-01T13:11:13.719-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Dot Net Videos'/><title type='text'>Dot Net Videos</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;What are generics?&lt;/h2&gt;&lt;iframe allowfullscreen="" frameborder="1" height="315" src="http://www.youtube.com/embed/ecbv4bsxkvk" width="560"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;What is a SQL Injection Attack?&lt;/h2&gt;&lt;iframe allowfullscreen="" frameborder="1" height="315" src="http://www.youtube.com/embed/uSw0IoSr3Hk?rel=0" width="560"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-3604780015559393919?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/3604780015559393919/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2011/11/dot-net-videos.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/3604780015559393919'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/3604780015559393919'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2011/11/dot-net-videos.html' title='Dot Net Videos'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/ecbv4bsxkvk/default.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-8196996559791776552</id><published>2011-09-03T08:26:00.000-07:00</published><updated>2011-12-01T13:12:37.618-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET Page is very slow. What will you do to make it fast'/><category scheme='http://www.blogger.com/atom/ns#' term='troubleshoot performance issue'/><title type='text'>ASP.NET Page is very slow. What will you do to make it fast</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;This is a very common asp.net interview question asked in many interviews. There are several reasons for the page being slow. We need to identify the cause. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;1.&lt;/strong&gt; Find out which is slow, is it the &lt;strong&gt;application &lt;/strong&gt;or the &lt;strong&gt;database&lt;/strong&gt; : If the page is executing SQL queries or stored procedures, run those on the database and check how long do they take to run. If the queries are taking most of the time, then you know you have to tune the queries for better performance. To tune the queries, there are several ways and I have listed some of them below.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; a) Check if there are indexes to help the query&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; b) Select only the required columns, avoid &lt;strong&gt;&lt;span style="color: blue;"&gt;Select *.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; c) Check if there is a possiblity to reduce the number of joins&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; d) If possible use &lt;strong&gt;&lt;span style="color: blue;"&gt;NO LOCK &lt;/span&gt;&lt;/strong&gt;on your select statements&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; e) Check if there are cursors and if you can replace them with joins&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;2.&lt;/strong&gt; If the queries are running fast, then we know it is the &lt;strong&gt;application code &lt;/strong&gt;that is causing the slowness. Isolate the page event that is causing the issue by turning tracing on. To turn tracing on, set &lt;strong&gt;&lt;span style="color: blue;"&gt;Trace="true"&lt;/span&gt;&lt;/strong&gt; in the page directive. Once you have tracing turned on you should see trace information at the bottom of the page as shown in the image below. In this case Page Load event is taking the maximum time. So we know, the code in &lt;strong&gt;&lt;span style="color: blue;"&gt;Page_Load &lt;/span&gt;&lt;/strong&gt;event is causing the issue. Once you look at the code, you should be able to nail down the issue.&lt;/span&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;img border="1" src="http://3.bp.blogspot.com/--Tixyx637yY/TmJG0Zi0v_I/AAAAAAAAAIA/X0kXmY87dmk/s1600/PageSlow.png" xaa="true" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/tbody&gt;&lt;/tr&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-8196996559791776552?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/8196996559791776552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2011/09/aspnet-page-is-very-slow-what-will-you.html#comment-form' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/8196996559791776552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/8196996559791776552'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2011/09/aspnet-page-is-very-slow-what-will-you.html' title='ASP.NET Page is very slow. What will you do to make it fast'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/--Tixyx637yY/TmJG0Zi0v_I/AAAAAAAAAIA/X0kXmY87dmk/s72-c/PageSlow.png' height='72' width='72'/><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-7494553580419694091</id><published>2011-07-21T13:03:00.000-07:00</published><updated>2011-12-01T13:14:06.251-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Injection Attack with an example'/><title type='text'>What is SQL Injection Attack</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Let us understand &lt;strong&gt;SQL injection attack&lt;/strong&gt;, with an example. I have an &lt;span style="color: #660000;"&gt;&lt;strong&gt;Employee Search Page&lt;/strong&gt; &lt;/span&gt;as shown in the image below. This webform has a very simple functionality. You enter the ID of the employee, you want to search and click the &lt;strong&gt;&lt;span style="color: #660000;"&gt;Search Employee button&lt;/span&gt;&lt;/strong&gt;. If a match is found in the database, we show the employee record in the &lt;span style="color: #660000;"&gt;GridView&lt;/span&gt;.&lt;/span&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: #660000;"&gt;Employee Search Page&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;img border="1" src="http://4.bp.blogspot.com/-oPNfz3LirRk/TiiFNFL8VXI/AAAAAAAAAHo/0rvYwua1k-w/s1600/EmployeeSearch.png" t$="true" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;The HTML for the &lt;strong&gt;&lt;span style="color: #660000;"&gt;Employee Serach Page &lt;/span&gt;&lt;/strong&gt;is shown below. As you can see from the HTML, the &lt;strong&gt;&lt;span style="color: #660000;"&gt;Employee Serach Page&lt;/span&gt;&lt;/strong&gt; contains TextBox, Button and a GridView control.&lt;/span&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: #660000;"&gt;Employee Search Page HTML&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;img border="1" src="http://2.bp.blogspot.com/-MJBISzaxxs0/TiiG2ZsYp5I/AAAAAAAAAHs/4Jsrgzo0nfo/s1600/EmployeeSearchPageHTML.png" t$="true" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;The &lt;strong&gt;&lt;span style="color: #660000;"&gt;codebehind&lt;/span&gt;&lt;/strong&gt; page for the EmployeeSearchPage is shown below. &lt;/span&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;&lt;span style="color: #660000;"&gt;Employee Search Page Code Behind&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;img border="1" src="http://2.bp.blogspot.com/-2Qf8EyCN1lE/TiiHztglZbI/AAAAAAAAAHw/ZQvrFMxo6vg/s1600/EmployeeSearchPageCodeBehind.png" t$="true" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;The &lt;strong&gt;&lt;span style="color: #660000;"&gt;Button1_Click&lt;/span&gt;&lt;/strong&gt; event handler has the required ADO.NET code to get data from the database. This code is highly &lt;strong&gt;&lt;span style="color: #660000;"&gt;susceptible to sql injection attack &lt;/span&gt;&lt;/strong&gt;and I will never ever have code like this in production environment. The &lt;strong&gt;&lt;span style="color: #660000;"&gt;second line in Button1_Click event handler&lt;/span&gt;&lt;/strong&gt;, dynamically builds the sql query by concatenating the &lt;strong&gt;&lt;span style="color: #660000;"&gt;Employee ID&lt;/span&gt;&lt;/strong&gt; that we typed into the &lt;strong&gt;&lt;span style="color: #660000;"&gt;TextBox&lt;/span&gt;&lt;/strong&gt;. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;So, for example, if we had typed 2 into the &lt;strong&gt;&lt;span style="color: #660000;"&gt;Employee ID textbox&lt;/span&gt;&lt;/strong&gt;, we will have a SQL query as shown below.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0b5394; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;Select * from Employees where Id=2&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;If a malicious user, types something like &lt;strong&gt;&lt;span style="color: #660000;"&gt;2; Delete from Employees&lt;/span&gt;&lt;/strong&gt; into the TextBox, then we will have a SQL query as shown below.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0b5394; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;Select * from Employees where Id=2; Delete from Employees&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;When this query is executed, we loose all the data in the &lt;strong&gt;&lt;span style="color: #660000;"&gt;Employees&lt;/span&gt;&lt;/strong&gt; table. This is &lt;strong&gt;&lt;span style="color: #660000;"&gt;SQL Injection Attack&lt;/span&gt;&lt;/strong&gt;, as the user of the application is able to inject SQL and get it executed against the database. It is very easy to avoid SQL Injection attacks by using either &lt;strong&gt;&lt;span style="color: #660000;"&gt;parameterized queries&lt;/span&gt;&lt;/strong&gt; or using &lt;strong&gt;&lt;span style="color: #660000;"&gt;stored procedures&lt;/span&gt;&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;You may be thinking, how will the user of the application know the name of the table. Well, one way is to &lt;strong&gt;&lt;span style="color: #660000;"&gt;simply guess &lt;/span&gt;&lt;/strong&gt;or &lt;strong&gt;&lt;span style="color: #660000;"&gt;inject a sql syntax error&lt;/span&gt;&lt;/strong&gt;. The injected SQL syntax error causes the page to crash and can possibly reveal the name of the table as shown below. However, proper exception handling and custom error pages can be used to prevent the end user from seeing the yello screen of death. The screen shot below shows the table name &lt;strong&gt;&lt;span style="color: #660000;"&gt;Employees&lt;/span&gt;&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: #660000;"&gt;Page crash revealing Employees table name&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;img border="1" src="http://1.bp.blogspot.com/-TYBgb39io9E/TiiKLo-ODFI/AAAAAAAAAH0/90jJ4KtQtlA/s1600/PageCrash.png" t$="true" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-7494553580419694091?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/7494553580419694091/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2011/07/what-is-sql-injection-attack.html#comment-form' title='17 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/7494553580419694091'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/7494553580419694091'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2011/07/what-is-sql-injection-attack.html' title='What is SQL Injection Attack'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-oPNfz3LirRk/TiiFNFL8VXI/AAAAAAAAAHo/0rvYwua1k-w/s72-c/EmployeeSearch.png' height='72' width='72'/><thr:total>17</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-7721887831940741499</id><published>2011-07-12T10:21:00.000-07:00</published><updated>2011-12-01T13:15:52.969-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Reusable SQL function to split a string'/><title type='text'>Reusable SQL function to split a string</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;Write a reusable split function that can be used to split any given string with a given delimiter?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;To further understand the question better, consider the examples below&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Input String : &lt;strong&gt;123|456|234|435&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Delimiter Character : &lt;strong&gt;|&lt;/strong&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;The output should be as shown below:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;101&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;102&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;103&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;104&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;105&lt;/span&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;&lt;span style="color: blue;"&gt;Create Function&lt;/span&gt;&lt;/strong&gt; SplitFunction (@InputString &lt;strong&gt;&lt;span style="color: blue;"&gt;nvarchar&lt;/span&gt;&lt;/strong&gt;(&lt;strong&gt;&lt;span style="color: magenta;"&gt;max&lt;/span&gt;&lt;/strong&gt;), @Delimiter &lt;strong&gt;&lt;span style="color: blue;"&gt;Char&lt;/span&gt;&lt;/strong&gt;(1))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;&lt;span style="color: blue;"&gt;Returns&lt;/span&gt;&lt;/strong&gt; @ResultTable &lt;strong&gt;&lt;span style="color: blue;"&gt;Table&lt;/span&gt;&lt;/strong&gt; (Items nvarchar(4000))&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;as&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;Begin&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;span style="color: blue;"&gt;Declare&lt;/span&gt;&lt;/strong&gt; @Index &lt;strong&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;span style="color: blue;"&gt;Declare&lt;/span&gt;&lt;/strong&gt; @Slice &lt;strong&gt;&lt;span style="color: blue;"&gt;nvarchar&lt;/span&gt;&lt;/strong&gt;(4000)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;span style="color: blue;"&gt;Set&lt;/span&gt;&lt;/strong&gt; @Index = 1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;span style="color: blue;"&gt;If&lt;/span&gt;&lt;/strong&gt;(@InputString is null)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;span style="color: blue;"&gt;Begin&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp; End&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;span style="color: blue;"&gt;While&lt;/span&gt;&lt;/strong&gt; (@Index != 0)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;span style="color: blue;"&gt;Begin&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;span style="color: blue;"&gt;Set&lt;/span&gt;&lt;/strong&gt; @Index = CHARINDEX(@Delimiter, @InputString)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;span style="color: blue;"&gt;If&lt;/span&gt;&lt;/strong&gt;(@Index != 0)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;span style="color: blue;"&gt;Begin&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;span style="color: blue;"&gt;Select&lt;/span&gt;&lt;/strong&gt; @Slice = LEFT(@InputString, @Index - 1)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;span style="color: blue;"&gt;End&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Begin&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;span style="color: blue;"&gt;Select&lt;/span&gt;&lt;/strong&gt; @Slice = @InputString&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;span style="color: blue;"&gt;End&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;span style="color: blue;"&gt;Insert into&lt;/span&gt;&lt;/strong&gt; @ResultTable(Items) &lt;strong&gt;&lt;span style="color: blue;"&gt;Values&lt;/span&gt;&lt;/strong&gt; (@Slice)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;span style="color: blue;"&gt;SET&lt;/span&gt;&lt;/strong&gt; @InputString = RIGHT(@InputString, LEN(@InputString) - @Index)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;span style="color: blue;"&gt;If&lt;/span&gt;&lt;/strong&gt;(LEN(@InputString)) = 0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;span style="color: blue;"&gt;Begin&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Break;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;&amp;nbsp; End&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;&amp;nbsp; Return&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;End&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;When we execute &lt;strong&gt;&lt;span style="color: blue;"&gt;Select&lt;/span&gt; * &lt;span style="color: blue;"&gt;from&lt;/span&gt; SplitFunction('123|456|234|435','|')&lt;/strong&gt;, we get the desired output. You may try with different inputs and delimiters.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;This split function is a classic example for &lt;strong&gt;multi-statement table valued function in SQL server&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-7721887831940741499?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/7721887831940741499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2011/07/reusable-sql-function-to-split-string.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/7721887831940741499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/7721887831940741499'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2011/07/reusable-sql-function-to-split-string.html' title='Reusable SQL function to split a string'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-5276916328141860130</id><published>2011-06-09T10:59:00.000-07:00</published><updated>2011-12-01T13:16:37.631-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='When do you use Setter Injection over Constructor Injection'/><category scheme='http://www.blogger.com/atom/ns#' term='What Dependency Injection Container have you used in your project'/><category scheme='http://www.blogger.com/atom/ns#' term='advantages of using Dependency Injection'/><title type='text'>Interview Questions related to Dependency Injection</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="display:block;float:right;margin: 5px;"&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/div&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/06/explain-dependency-injection-with.html"&gt;It is very important that, you understand the concept of dependency injection before you read these questions. Please read Dependency Injection with an example article if you have not done so already.&lt;/a&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;When do you use Setter Injection over Constructor Injection and vice versa ?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Constructor Injection is normally the standard for dependency injection. Constructor Injection, ensures that all the dependency objects are initialized before we attempt to invoke any methods or peroperties, thus avoiding null reference exceptions. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Setter Injection is used rarely in exceptional cases. For example, if I have a class that has several methods which does not depend on any other objects, and now I need to introduce a new method with in this class, which depends on another object. We can use, constructor injection here, but we need to change the exisitng constructor calls at all the other places. This can become cumbersome, especially if the project is a huge one. Hence, Setter Injection could be a choice when we want to change the legacy code. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Setter Injection, enables you to inject the object, just before you need it. So, if the object is an expensive object to create, and you want to create it as late as possible, then setter injection is your choice.&lt;/span&gt;&lt;br /&gt;&lt;div style="display:block;float:right;margin: 5px;"&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;What are the advantages of using Dependency Injection?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;1.&lt;/strong&gt; Dependency Injection allows us to develop very loosely coupled systems.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;2.&lt;/strong&gt; Easy to swap in a different implementation of a component, as long as the component implements the interface type.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;3.&lt;/strong&gt; Dependency Injection, allows objects to be mocked with in the Unit Tests. This is the greatest advantage of Dependency Injection.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;What Dependency Injection Container have you used in your project?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;There are lot of Dependency Injection Containers available in the market. I have included, the very commonly used list of Dependency Injection Containers for your quick refernce.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;1.&lt;/strong&gt; Unity&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;2.&lt;/strong&gt; Castle Windsor &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;3.&lt;/strong&gt; StructureMap &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;4.&lt;/strong&gt; Spring.NET &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;I have used Unity in most of my projects.&lt;br /&gt;&lt;br /&gt;If you can improve any of these answer further, please feel free to do so by submitting the form below. Thank you very much for your contribution.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-5276916328141860130?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/5276916328141860130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2011/06/interview-questions-related-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/5276916328141860130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/5276916328141860130'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2011/06/interview-questions-related-to.html' title='Interview Questions related to Dependency Injection'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-1126961537800488368</id><published>2011-06-08T13:32:00.000-07:00</published><updated>2011-12-01T13:17:59.966-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Constructor'/><category scheme='http://www.blogger.com/atom/ns#' term='Dependency Injection with an example'/><category scheme='http://www.blogger.com/atom/ns#' term='setter'/><title type='text'>Explain Dependency Injection with an example</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;One of the very common interview questions, asked these days. This is the most common approach used today to solve dependencies between objects. In many of the enterprise class ASP.NET application, Dependency Injection is a common standard to follow. Let us understand Dependency Injection with an example.&lt;/span&gt;&lt;br /&gt;&lt;div style="display:block;float:right;margin: 5px;"&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/div&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;img border="1" src="http://2.bp.blogspot.com/-TN2uNRQQdk8/Te_crUOZeGI/AAAAAAAAAGw/dOVAAsIE4Dw/s1600/DependencyInjection.png" t8="true" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;In the example above, &lt;span style="color: blue;"&gt;Employee&lt;/span&gt; class depends on &lt;span style="color: blue;"&gt;EmployeeDAL&lt;/span&gt; class to get the data from the database. In &lt;span style="color: blue;"&gt;GetAllEmployees()&lt;/span&gt; method of the &lt;span style="color: blue;"&gt;Employee&lt;/span&gt; class, we create an instance of the &lt;span style="color: blue;"&gt;EmployeeDAL&lt;/span&gt; (Employee Data Access Layer) class and then invoke &lt;span style="color: blue;"&gt;SelectAllEmployees()&lt;/span&gt; method. This is tight coupling, &lt;span style="color: blue;"&gt;EmployeeDAL&lt;/span&gt; is tightly copuled with the &lt;span style="color: blue;"&gt;Employee&lt;/span&gt; class. Everytime the &lt;span style="color: blue;"&gt;EmployeeDAL&lt;/span&gt; class changes, the &lt;span style="color: blue;"&gt;Employee&lt;/span&gt; class also needs to change. &lt;span style="color: blue;"&gt;EmployeeDAL&lt;/span&gt; cannot be mocked and hence unit testing becomes cumbersome and time consuming. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;The same example can be re-written using dependency injection as shown below. First thing to notice is that, we are using &lt;strong&gt;&lt;span style="color: #20124d;"&gt;interface types instead of concrete types&lt;/span&gt;&lt;/strong&gt;. Using interfaces help us to plugin any implemenation of the interface, with less or no code modification at all. We are not creating the instance of the &lt;span style="color: blue;"&gt;EmployeeDAL&lt;/span&gt; in the &lt;span style="color: blue;"&gt;Employee&lt;/span&gt; class, instead we are passing it as a parameter to the constructor of the &lt;span style="color: blue;"&gt;Employee&lt;/span&gt; class. As, we are injecting an instance of a class into a class that depends on it, we can call this process as &lt;strong&gt;Dependency Injection&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;&lt;div style="display:block;float:right;margin: 5px;"&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/div&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;img border="1" src="http://1.bp.blogspot.com/-9LCE73kiDPI/Te_dF_wLMwI/AAAAAAAAAG0/W9Cj-MK-liw/s1600/ConstructorInjection.png" t8="true" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Dependency Injection is of 2 types.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;1.&lt;/strong&gt; Constructor Injection&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;2.&lt;/strong&gt; Setter Injection.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;We have already seen how to use Constructor Injection in the example above. An, example for Setter Injection is shown below. We are injecting an object instance through the Setter property, instead of a constructor. Hence, we call Setter Injection. It is very important to use the property &lt;span style="color: blue;"&gt;EmployeeDataObject&lt;/span&gt; to access the instance of &lt;span style="color: blue;"&gt;IEmployeeDAL&lt;/span&gt;, rather than the private variable &lt;span style="color: blue;"&gt;employeeDAL&lt;/span&gt;. The property checks to see if &lt;span style="color: blue;"&gt;employeeDAL&lt;/span&gt; is null, and throws the exception accordingly.&lt;/span&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;img border="1" src="http://4.bp.blogspot.com/-FI2QmuyR12A/Te_dpr3i5tI/AAAAAAAAAG4/CgAxXvv9uT0/s1600/SetterInjection.png" t8="true" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;For other follow up interview questions on Dependency Injection, please read the articles below. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/06/interview-questions-related-to.html"&gt;1. When do you choose Setter Injection over Constructor Injection and vice versa ?&lt;/a&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/06/interview-questions-related-to.html"&gt;2. What are the advantages of using Dependency Injection ?&lt;/a&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/06/interview-questions-related-to.html"&gt;3. What Dependency Injection Container have you used in your project ?&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;b&gt;If you can improve any of these answer further, please feel free to do so by submitting the form below. Thank you very much for your contribution.&lt;/b&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-1126961537800488368?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/1126961537800488368/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2011/06/explain-dependency-injection-with.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/1126961537800488368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/1126961537800488368'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2011/06/explain-dependency-injection-with.html' title='Explain Dependency Injection with an example'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-TN2uNRQQdk8/Te_crUOZeGI/AAAAAAAAAGw/dOVAAsIE4Dw/s72-c/DependencyInjection.png' height='72' width='72'/><thr:total>1</thr:total><georss:featurename>United States</georss:featurename><georss:point>37.09024 -95.71289100000001</georss:point><georss:box>10.70899 -156.97250350000002 63.47149 -34.45327850000001</georss:box></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-3566181221022163524</id><published>2011-06-06T13:53:00.000-07:00</published><updated>2011-12-01T13:18:46.015-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='weak'/><category scheme='http://www.blogger.com/atom/ns#' term='named'/><category scheme='http://www.blogger.com/atom/ns#' term='.exe'/><category scheme='http://www.blogger.com/atom/ns#' term='strong'/><category scheme='http://www.blogger.com/atom/ns#' term='differences'/><category scheme='http://www.blogger.com/atom/ns#' term='difference'/><category scheme='http://www.blogger.com/atom/ns#' term='assemblies'/><category scheme='http://www.blogger.com/atom/ns#' term='advantages'/><category scheme='http://www.blogger.com/atom/ns#' term='assembly'/><title type='text'>Interview Questions related to strong named assemblies</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;Can you copy a weak named assembly into GAC?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;No&lt;/strong&gt;, an assembly has to be strongly named to be copied into the GAC&lt;/span&gt;&lt;br /&gt;&lt;div style="display:block;float:right;margin: 5px;"&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;What is the difference between a strong and weak named assemblies?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;The following are the differences between a strong and weak named assemblies&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;1.&lt;/strong&gt; Weak named assemblies can be duplicated and tampered with, where as strong named assemblies cannoth be tampered and duplicated. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;2.&lt;/strong&gt; Strong named assemblies can be copied into GAC, where as weak named assemblies cannot be copied.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;3.&lt;/strong&gt; A single copy of strong named assembly present in the GAC can be shared with multiple applications, where as weak named assembly must be copied into the bin directory of each project.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;What is the main advantage of strong naming an assembly?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;A shared assembly that is strongly named solves the DLL hell problem, that microsoft is notoriously known for. Please follow the articles below, to understand DLL hell and the solution.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/what-is-dll-hell-in-net.html"&gt;What is DLL hell&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/06/how-is-dll-hell-problem-solved-in-net.html"&gt;How is DLL hell problem solved&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;Can a strong named assembly refer, a weak named assembly and why?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;No, a strong named assembly cannot reference, another weak named assembly. If this is possible, the DLL hell problem will reoccur. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;Explantion:&lt;/strong&gt; When you reference a strong named assembly, you expect to get certain benefits, such as versioning and naming protection. If the strong named assembly then references an assembly with a simple name, which does not have these benefits, you lose the benefits you would derive from using a strong named assembly and revert to DLL conflicts. Therefore, strong named assemblies can only reference other strong named assemblies.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;What is the downside of strong naming an executable (.EXE) ?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;A strongly named assembly cannot reference a weak named assembly. Therefore, strong naming an EXE prevents the EXE from referencing weak named dlls, that are deployed with the application. For this reason, the Visual Studio project system does not strong name application EXEs. Instead, it strong-names the Application manifest, which internally points to the weak named application EXE. In addition, you may want to avoid strong-naming components that are private to your application. In this case, strong-naming can make it more difficult to manage dependencies and add unnecessary overhead for private components.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;If you can improve any of these answer further, please feel free to do so by submitting the form below. Thank you very much for your contribution.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-3566181221022163524?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/3566181221022163524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2011/06/interview-questions-related-to-strong.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/3566181221022163524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/3566181221022163524'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2011/06/interview-questions-related-to-strong.html' title='Interview Questions related to strong named assemblies'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-7547471725290590039</id><published>2011-06-06T12:48:00.000-07:00</published><updated>2011-06-13T12:00:58.655-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='generate a strong name'/><category scheme='http://www.blogger.com/atom/ns#' term='strong naming an assembly'/><title type='text'>What is the process for strong naming an assembly</title><content type='html'>&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="width:650px"&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="width: 180px;padding-top:1px;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 8pt; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 8pt; line-height: 140%; padding-left: 6px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 8pt; line-height: 140%; padding-left: 6px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 8pt; line-height: 140%; padding-left: 6px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 8pt; line-height: 140%; padding-left: 6px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 8pt; line-height: 140%; padding-left: 6px; text-decoration: underline;"&gt;HR Interview Questions&lt;/span&gt;&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td style="border-top:1px solid black; text-align:center;color: black; font-family: Arial; font-size: 13pt; font-weight: bold;" colspan="2"&gt;Search This Site&lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input type="hidden" name="cx" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input type="hidden" name="cof" value="FORID:11" /&gt;&lt;input type="hidden" name="ie" value="ISO-8859-1" /&gt;&lt;input type="text" name="q" size="40" /&gt;&lt;input type="submit" name="sa" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="display:block;float:right;margin: 5px;"&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/div&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;What is the process for strong naming an assembly ?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;or&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;What is the purpose of strong naming tool ( sn.exe ) in .NET ?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;In .NET, the &lt;strong&gt;assembly name &lt;/strong&gt;usually consists of &lt;strong&gt;4 parts &lt;/strong&gt;as listed below.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;1.&lt;/strong&gt; Simple Textual Name&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;2.&lt;/strong&gt; Version Number (The version number is also divided into 4 parts)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;3.&lt;/strong&gt; Culture&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;4.&lt;/strong&gt; Public Key Token &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;If an assembly contains, all the 4 parts, then the assembly is a &lt;strong&gt;strongly named assembly&lt;/strong&gt;, other wise the assembly is called as a &lt;strong&gt;weak named assembly&lt;/strong&gt;. In general, when you compile any .NET application, the generated assembly by default will have the Simple Textual Name, Version Number and Culture but not the public key token. If you have to sign the assembly with a public key token, you first have to generate the key pair using &lt;strong&gt;key generation tool &lt;/strong&gt;called &lt;strong&gt;strong naming tool (sn.exe)&lt;/strong&gt;. The generated key pair will consist of a &lt;strong&gt;private and a public key&lt;/strong&gt; and are written into a key file. &lt;strong&gt;Key files&lt;/strong&gt; have the extension of &lt;strong&gt;.snk&lt;/strong&gt;. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;We now have to associate the &lt;strong&gt;key file &lt;/strong&gt;with the &lt;strong&gt;project&lt;/strong&gt;, so that when we compile the project, the generated assembly is signed using the key pair. To do this, In &lt;strong&gt;&lt;span style="color: blue;"&gt;AssemblyInfo.cs&lt;/span&gt;&lt;/strong&gt; file of the project, specify &lt;strong&gt;&lt;span style="color: blue;"&gt;AssemblyKeyFile&lt;/span&gt;&lt;/strong&gt; attribute as shown below.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [assembly: AssemblyKeyFile("MyKey.snk")]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;The last and final step is to build the project which will automatically sign the assembly using the key file. This process generates the strongly named assembly.&lt;/span&gt;&lt;br /&gt;&lt;div style="display:block;float:right;margin: 5px;"&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;In short, there are 3 simple steps to generate a strongly named assembly.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;1.&lt;/strong&gt; Generate the key pair using strong naming tool, SN.exe.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;2.&lt;/strong&gt; Associate the generated Key file to the project using AssemblyKeyFile, which is present in AssemblyInfo.cs file.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;3.&lt;/strong&gt; Build the project.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;Once, you have strongly named the assembly, you can copy it to GAC. There are 2 ways to copy an assembly into GAC.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;1.&lt;/strong&gt; &lt;strong&gt;Using simple drag and drop&lt;/strong&gt; : Drag the generated assembly into the GAC folder. Usually the path for GAC is &lt;strong&gt;c:\windows\assembly&lt;/strong&gt;. On some machines this could be &lt;strong&gt;c:\winnt\assembly&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;2. Use GAC utility&lt;/strong&gt; : Use GAC Utility tool(&lt;strong&gt;gacutil.exe&lt;/strong&gt;) as shown below in visual studio command prompt. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;span style="color: blue;"&gt;gacutil.exe -i C:\MyAssembly.dll (- i stands for install)&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Once, you have successfuly copied the assembly into GAC, notice the four parts of the assembly name. The &lt;strong&gt;culture&lt;/strong&gt; column could be empty, indicating that the assembly is language neutral. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Please click here to read few other follow up interview questions related to strong named assemblies.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;If you can improve this answer further, please feel free to do so by submitting the form below. Thank you very much for your contribution.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="width: 180px;padding-top:1px;"&gt;&lt;span style="color: black; font-family: Arial; font-size: 8pt; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 8pt; line-height: 140%; padding-left: 6px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 8pt; line-height: 140%; padding-left: 6px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 8pt; line-height: 140%; padding-left: 6px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 8pt; line-height: 140%; padding-left: 6px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 8pt; line-height: 140%; padding-left: 6px; text-decoration: underline;"&gt;HR Interview Questions&lt;/span&gt;&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td style="border-top:1px solid black; text-align:center;color: black; font-family: Arial; font-size: 13pt; font-weight: bold;" colspan="2"&gt;Search This Site&lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input type="hidden" name="cx" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input type="hidden" name="cof" value="FORID:11" /&gt;&lt;input type="hidden" name="ie" value="ISO-8859-1" /&gt;&lt;input type="text" name="q" size="40" /&gt;&lt;input type="submit" name="sa" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-7547471725290590039?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/7547471725290590039/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2011/06/what-is-process-for-strong-naming.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/7547471725290590039'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/7547471725290590039'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2011/06/what-is-process-for-strong-naming.html' title='What is the process for strong naming an assembly'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-2539155100089416344</id><published>2011-06-03T11:18:00.000-07:00</published><updated>2011-12-12T12:01:19.971-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET Interview Questions'/><title type='text'>ASP.NET Interview Questions Index</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;tr&gt;&lt;td style="color: #0066cc; font-family: Arial; font-size: small;"&gt;&lt;br /&gt;&lt;span style="color: black;"&gt;&lt;strong&gt;On this page you can see list of all ASP.NET Interview Questions by topic. In most of the interviews, these questions are very frequently asked. If you have an asp.net question that is asked in a previous interview, please post it here.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/12/when-i-create-new-aspnet-4-web.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;When I create a new ASP.NET 4 web application, the web.config file is almost empty. What happened to all the configuration elements that were there prior to ASP.NET 4?&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/12/difference-between-enableviewstate-and.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;What is the difference between EnableViewState and ViewStateMode properties&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/09/aspnet-page-is-very-slow-what-will-you.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Page is very slow. What will you do to make it fast&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/07/what-is-sql-injection-attack.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Explain SQL Injection Attack with an example&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/06/explain-dependency-injection-with.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Explain Dependency Injection with an example ?&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/06/interview-questions-related-to.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Interview Questions related to Dependency Injection ?&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/06/what-is-process-for-strong-naming.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;What is the process of strong naming an assembly ?&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/06/interview-questions-related-to-strong.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Interview Questions related to strong named assemblies&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/06/how-is-dll-hell-problem-solved-in-net.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;How is the DLL HELL problem solved in .NET?&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/what-is-dll-hell-in-net.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;What is DLL HELL in .NET?&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/03/what-is-difference-between-layers-and.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;What is the difference between layers and tiers?&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/03/what-are-advantages-and-disadvantages.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;What are the advantages and disadvantages of a layered architecture&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2010/06/what-is-difference-between-const-and.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;What is the difference between const and static read-only member?&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2010/06/linq-interview-questions-part-1.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Linq Interview Questions Part 1&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2010/06/linq-interview-questions-part-2.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Linq Interview Questions Part 2&lt;/span&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2010/01/best-pactices-in-developing-aspnet.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Best pactices in developing asp.net web applications - Part 1&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2010/01/best-pactices-in-developing-aspnet_09.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Best pactices in developing asp.net web applications - Part 2&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2009/01/aspnet-interview-questions-on-data.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on Data Access Security&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/11/aspnet-interview-questions-on-http.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on HTTP modules and HTTP Handlers&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/11/aspnet-interview-questions-on-themes.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on Themes and Skins&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/11/aspnet-interview-questions-on-dataset.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on DataSet&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/11/aspnet-interview-questions-on.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on Globalization&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/11/c-interview-questions-arrays.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;C# Interview Questions - Arrays&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/11/xml-interview-questions-validating-xml.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;XML Interview Questions - Validating XML documents&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/11/xml-related-interview-questions.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;XML related Interview Questions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/aspnet-interview-questions-on-caching_24.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on caching application data&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/aspnet-interview-questions-on-fragment.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on fragment caching&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/aspnet-interview-questions-on-caching.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on caching&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/application-build-related-aspnet.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Application build related ASP.NET Interview Questions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/aspnet-interview-questions-on-master.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on Master Pages&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/aspnet-interview-questions-on-passport.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on Passport authentication&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/ssl-and-https-related-aspnet-interview.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;SSL and HTTPS related ASP.NET Interview Questions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/aspnet-forms-authentication-related.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on forms authentication&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/08/aspnet-interview-questions-on-windows.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on windows authentication&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/frequently-asked-adonet-interview.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Frequently asked ADO.NET Interview Questions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/basic-adonet-interview-questions.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Basic ADO.NET Interview Questions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/interview-questions-on-aspnet-controls.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Interview Questions on ASP.NET controls&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/aspnet-interview-questions-on-cookies.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on Cookies&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/aspnet-events-related-interview.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Events related Interview Questions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/interview-questions-on-aspnet-exception.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Interview Questions on ASP.NET Exception Handling&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/managed-code-and-unmanaged-code-related.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Managed Code and Unmanaged Code related ASP.NET Interview Questions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/interview-questions-on-aspnet-page.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Interview Questions on ASP.NET Page navigation techniques&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/interview-questions-on-query-strings-in.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Interview Questions on Query Strings in ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/aspnet-interview-questions-on-web.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on web application Security&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/aspnet-session-state-and-application.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Session State and Application State Interview Questions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/techniques-to-send-data-from-one-web.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Techniques to send data from one web form to another web form&lt;/span&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/aspnet-interview-questions-on-tracing.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on Tracing&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/transactions-related-aspnet-interview.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Transactions related ASP.NET Interview Questions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/interview-questions-on-aspnet.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Interview Questions on ASP.NET Validation controls&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/aspnet-viewstate-related-interview.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET ViewState related Interview Questions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/web-application-maintainance-related.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Web Application maintainance related ASP.NET Interview Questions&lt;/span&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/aspnet-interview-questions-on-web-farm.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on web farm and web garden&lt;/span&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/aspnet-interview-questions-on-web-user.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on web user controls&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/interview-questions-on-aspnet-custom.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Interview Questions on ASP.NET Custom Controls&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/interview-questions-on-cascading-style.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Interview Questions on cascading style sheets&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-2539155100089416344?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/2539155100089416344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2011/06/aspnet-interview-questions-index_03.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/2539155100089416344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/2539155100089416344'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2011/06/aspnet-interview-questions-index_03.html' title='ASP.NET Interview Questions Index'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-8508901675435934533</id><published>2011-06-02T12:42:00.000-07:00</published><updated>2011-06-03T13:32:02.977-07:00</updated><title type='text'>Search Results</title><content type='html'>&lt;div id="cse-search-results"&gt;&lt;/div&gt;&lt;script type="text/javascript"&gt;  var googleSearchIframeName = "cse-search-results";  var googleSearchFormName = "cse-search-box";  var googleSearchFrameWidth = 800;  var googleSearchDomain = "www.google.com";  var googleSearchPath = "/cse";&lt;/script&gt;&lt;br /&gt;&lt;script src="http://www.google.com/afsonline/show_afs_search.js" type="text/javascript"&gt;&lt;/script&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td style="width:800px;border:1px solid #0066CC;"&gt;&lt;span style="color: black; padding-left:5px; font-family: Arial; font-size: 9pt; line-height: 130%; text-decoration: underline; font-weight:bold"&gt;All Questions&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 8pt; line-height: 140%; padding-left: 10px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 8pt; line-height: 140%; padding-left: 10px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 8pt; line-height: 140%; padding-left: 10px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 8pt; line-height: 140%; padding-left: 10px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 8pt; line-height: 140%; padding-left: 10px; text-decoration: underline;"&gt;HR Interview Questions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;hr style="color:#0066CC" /&gt;&lt;script type="text/javascript"&gt;&lt;!--    google_ad_client = "pub-5905727831268054";    /* HorizontalLinkUnit */    google_ad_slot = "6797222526";    google_ad_width = 468;    google_ad_height = 15;//--&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt; &lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-8508901675435934533?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/8508901675435934533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2011/06/search-results.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/8508901675435934533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/8508901675435934533'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2011/06/search-results.html' title='Search Results'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-5434944118099646751</id><published>2011-06-01T12:20:00.000-07:00</published><updated>2011-12-01T13:30:21.743-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='How is the DLL HELL problem solved in .NET'/><title type='text'>How is the DLL HELL problem solved in .NET</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/what-is-dll-hell-in-net.html"&gt;Please read What is dll hell? interview question, before proceeding with this article.&lt;/a&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;In short, the dll hell problem is solved in .NET by signing the shared assemblies with strong name. &lt;a href="http://venkataspinterview.blogspot.com/2011/06/what-is-process-for-strong-naming.html"&gt;Please follow this article, to understand the process of strong naming an assembly.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In dot net all the shared assemblies are usually in the GAC. GAC stands for Global Assembly Cache. The path for GAC is &lt;strong&gt;C:\[OperatingSystemDirectory]\assembly&lt;/strong&gt;. For example on my computer the path is &lt;strong&gt;C:\WINDOWS\assembly&lt;/strong&gt;. The image below shows the shared assemblies in the GAC.&lt;/span&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;img border="1" src="http://3.bp.blogspot.com/-3h9wj4-LqZU/TeaQG75xBjI/AAAAAAAAAGo/j6cSV-ZZHsA/s1600/GAC.png" t8="true" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Only strong named assemblies can be copied into GAC. Strong named assemblies in .NET has 4 pieces in its name as listed below.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;1.&lt;/strong&gt; Simple Textual Name&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;2.&lt;/strong&gt; Version Number&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;3.&lt;/strong&gt; Culture&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;4.&lt;/strong&gt; Public Key Token&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;All these four pieces put together, is called as the fully qualified name of the assembly. In the GAC image above &lt;strong&gt;Accessibility assembly &lt;/strong&gt;has a &lt;strong&gt;version of 2.0.0.0&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;Now consider the example below:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;1&lt;/strong&gt;. I have 2 applications, &lt;strong&gt;Application - A1&lt;/strong&gt; and &lt;strong&gt;Application - A2&lt;/strong&gt; which relies on the shared assembly &lt;strong&gt;Accessibility.dll (Version 2.0.0.0)&lt;/strong&gt; as shown in the image below.&lt;/span&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;img border="1" src="http://4.bp.blogspot.com/-Wy2MvPARtTA/TeaROJ-kFYI/AAAAAAAAAGs/kQODaRaugfQ/s1600/Dll+Hell+Solved.png" t8="true" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; Now, I have a latest version of &lt;strong&gt;Application - A2&lt;/strong&gt; available on the internet.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;3.&lt;/strong&gt; I download the latest version of &lt;strong&gt;A2&lt;/strong&gt; and install it on my machine. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;4.&lt;/strong&gt; This new installation copies a newer version of &lt;strong&gt;Accessibility.dll &lt;/strong&gt;into the GAC with version &lt;strong&gt;3.0.0.0.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;5.&lt;/strong&gt; So, in the GAC we now have &lt;strong&gt;2 versions of Accessibility.dll.&lt;/strong&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;6.&lt;/strong&gt; &lt;strong&gt;Application - A1&lt;/strong&gt; continues to use &lt;strong&gt;Accessibility.dll (version 2.0.0.0)&lt;/strong&gt; and &lt;strong&gt;Application - A2 uses Accessibility.dll (version 3.0.0.0)&lt;/strong&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;7.&lt;/strong&gt; So, now the assemblies are able to reside side by side in the GAC. For this reason dot net assemblies are also said to be supporting &lt;strong&gt;side by side execution.&lt;br /&gt;&lt;br /&gt;If you can improve this answer further, please feel free to do so by submitting the form below. Thank you very much for your contribution.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-5434944118099646751?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/5434944118099646751/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2011/06/how-is-dll-hell-problem-solved-in-net.html#comment-form' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/5434944118099646751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/5434944118099646751'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2011/06/how-is-dll-hell-problem-solved-in-net.html' title='How is the DLL HELL problem solved in .NET'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-3h9wj4-LqZU/TeaQG75xBjI/AAAAAAAAAGo/j6cSV-ZZHsA/s72-c/GAC.png' height='72' width='72'/><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-1881154732337701664</id><published>2011-05-31T11:57:00.000-07:00</published><updated>2011-12-01T13:32:26.666-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is DLL HELL in .NET'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET Interview Questions'/><title type='text'>What is DLL HELL in .NET</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Let us try and understand DLL HELL problem with an example. Please refer to the image below. &lt;a href="http://venkataspinterview.blogspot.com/2011/06/how-is-dll-hell-problem-solved-in-net.html"&gt;If you want to know how dll hell problem is solved in .net, you can read this article.&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="1" src="http://1.bp.blogspot.com/-GdfFIGaLmQs/TeU4FcNPW6I/AAAAAAAAAGk/lPEo1eZNHm0/s1600/DllHell.png" t8="true" /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;1.&lt;/strong&gt; I have 2 applications, A1 and A2 installed on my computer. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;2.&lt;/strong&gt; Both of these applications use shared assembly shared.dll&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;3.&lt;/strong&gt; Now, I have a latest version of Application - A2 available on the internet.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;4.&lt;/strong&gt; I download the latest version of A2 and install it on my machine.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;5.&lt;/strong&gt; This new installation has over written Shared.dll, which is also used by Application - A1.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;6.&lt;/strong&gt; Application - A2 works fine, but A1 fails to work, because the newly installed Shared.dll is not backward compatible.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;So, DLL HELL is a problem where one application will install a new version of the shared component that is not backward compatible with the version already on the machine, causing all the other existing applications that rely on the shared component to break. With .NET versioning we donot have DLL HELL problem any more.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/06/how-is-dll-hell-problem-solved-in-net.html"&gt;How is the DLL HELL problem solved in .NET, is another very important .net interview question. Click here to read.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;If you can improve this answer further, please feel free to do so by submitting the form below. Thank you very much for your contribution.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-1881154732337701664?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/1881154732337701664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2011/05/what-is-dll-hell-in-net.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/1881154732337701664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/1881154732337701664'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2011/05/what-is-dll-hell-in-net.html' title='What is DLL HELL in .NET'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-GdfFIGaLmQs/TeU4FcNPW6I/AAAAAAAAAGk/lPEo1eZNHm0/s72-c/DllHell.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-9071037752393112830</id><published>2011-05-22T03:49:00.000-07:00</published><updated>2011-12-12T12:02:49.428-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET Interview Questions'/><title type='text'>ASP.NET Interview Questions by topic</title><content type='html'>&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="color: #0066cc; font-family: Arial; font-size: small;"&gt;&lt;br /&gt;&lt;span style="color: black;"&gt;&lt;strong&gt;On this page you can see list of all ASP.NET Interview Questions by topic. In most of the interviews, these questions are very frequently asked. If you have an asp.net question that is asked in a previous interview, please post it here.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/12/when-i-create-new-aspnet-4-web.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;When I create a new ASP.NET 4 web application, the web.config file is almost empty. What happened to all the configuration elements that were there prior to ASP.NET 4?&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/09/aspnet-page-is-very-slow-what-will-you.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Page is very slow. What will you do to make it fast&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/12/difference-between-enableviewstate-and.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;What is the difference between EnableViewState and ViewStateMode properties&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/07/what-is-sql-injection-attack.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Explain SQL Injection Attack with an example ?&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/06/explain-dependency-injection-with.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Explain Dependency Injection with an example ?&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/06/interview-questions-related-to.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Interview Questions related to Dependency Injection ?&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/06/what-is-process-for-strong-naming.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;What is the process of strong naming an assembly ?&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/06/interview-questions-related-to-strong.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Interview Questions related to strong named assemblies&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/06/how-is-dll-hell-problem-solved-in-net.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;How is the DLL HELL problem solved in .NET?&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/what-is-dll-hell-in-net.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;What is DLL HELL in .NET?&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/03/what-is-difference-between-layers-and.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;What is the difference between layers and tiers?&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/03/what-are-advantages-and-disadvantages.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;What are the advantages and disadvantages of a layered architecture&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2010/06/what-is-difference-between-const-and.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;What is the difference between const and static read-only member?&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2010/06/linq-interview-questions-part-1.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Linq Interview Questions Part 1&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2010/06/linq-interview-questions-part-2.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Linq Interview Questions Part 2&lt;/span&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2010/01/best-pactices-in-developing-aspnet.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Best pactices in developing asp.net web applications - Part 1&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2010/01/best-pactices-in-developing-aspnet_09.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Best pactices in developing asp.net web applications - Part 2&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2009/01/aspnet-interview-questions-on-data.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on Data Access Security&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/11/aspnet-interview-questions-on-http.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on HTTP modules and HTTP Handlers&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/11/aspnet-interview-questions-on-themes.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on Themes and Skins&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/11/aspnet-interview-questions-on-dataset.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on DataSet&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/11/aspnet-interview-questions-on.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on Globalization&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/11/c-interview-questions-arrays.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;C# Interview Questions - Arrays&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/11/xml-interview-questions-validating-xml.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;XML Interview Questions - Validating XML documents&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/11/xml-related-interview-questions.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;XML related Interview Questions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/aspnet-interview-questions-on-caching_24.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on caching application data&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/aspnet-interview-questions-on-fragment.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on fragment caching&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/aspnet-interview-questions-on-caching.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on caching&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/application-build-related-aspnet.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Application build related ASP.NET Interview Questions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/aspnet-interview-questions-on-master.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on Master Pages&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/aspnet-interview-questions-on-passport.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on Passport authentication&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/ssl-and-https-related-aspnet-interview.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;SSL and HTTPS related ASP.NET Interview Questions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/aspnet-forms-authentication-related.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on forms authentication&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/08/aspnet-interview-questions-on-windows.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on windows authentication&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/frequently-asked-adonet-interview.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Frequently asked ADO.NET Interview Questions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/basic-adonet-interview-questions.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Basic ADO.NET Interview Questions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/interview-questions-on-aspnet-controls.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Interview Questions on ASP.NET controls&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/aspnet-interview-questions-on-cookies.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on Cookies&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/aspnet-events-related-interview.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Events related Interview Questions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/interview-questions-on-aspnet-exception.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Interview Questions on ASP.NET Exception Handling&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/managed-code-and-unmanaged-code-related.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Managed Code and Unmanaged Code related ASP.NET Interview Questions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/interview-questions-on-aspnet-page.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Interview Questions on ASP.NET Page navigation techniques&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/interview-questions-on-query-strings-in.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Interview Questions on Query Strings in ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/aspnet-interview-questions-on-web.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on web application Security&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/aspnet-session-state-and-application.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Session State and Application State Interview Questions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/techniques-to-send-data-from-one-web.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Techniques to send data from one web form to another web form&lt;/span&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/aspnet-interview-questions-on-tracing.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on Tracing&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/transactions-related-aspnet-interview.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Transactions related ASP.NET Interview Questions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/interview-questions-on-aspnet.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Interview Questions on ASP.NET Validation controls&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/07/aspnet-viewstate-related-interview.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET ViewState related Interview Questions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/web-application-maintainance-related.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Web Application maintainance related ASP.NET Interview Questions&lt;/span&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/aspnet-interview-questions-on-web-farm.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on web farm and web garden&lt;/span&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/aspnet-interview-questions-on-web-user.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;ASP.NET Interview Questions on web user controls&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/interview-questions-on-aspnet-custom.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Interview Questions on ASP.NET Custom Controls&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2008/10/interview-questions-on-cascading-style.html"&gt;&lt;span style="color: #0066cc; text-decoration: none;"&gt;Interview Questions on cascading style sheets&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-9071037752393112830?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/9071037752393112830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/9071037752393112830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/9071037752393112830'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html' title='ASP.NET Interview Questions by topic'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-6926823781058602634</id><published>2011-03-10T14:39:00.000-08:00</published><updated>2011-12-01T13:35:37.037-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='advantages and disadvantages of a layered architecture'/><title type='text'>What are the advantages and disadvantages of a layered architecture</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;The following are the advantages of a layered architecture:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;Layered architecture increases flexibility, maintainability, and scalability.&lt;/strong&gt; In a Layered architecture we separate the user interface from the business logic, and the business logic from the data access logic. Separation of concerns among these logical layers and components is easily achieved with the help of layered architecture.&lt;/span&gt;&lt;br /&gt;&lt;div style="display:block;float:right;margin: 5px;"&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;Multiple applications can reuse the components.&lt;/strong&gt; For example if we want a windows user interface rather than a web browser interface, this can be done in an easy and fast way by just replacing the UI component. All the other components like business logic, data access and the database remains the same. Layered architecture allows to swap and reuse components at will.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;Layered architecture&lt;/strong&gt; enables teams to work on different parts of the application parallely with minimal dependencies on other teams.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;Layered architecture &lt;/strong&gt;enables develop loosely coupled systems.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;Different components&lt;/strong&gt; of the application can be independently deployed, maintained, and updated, on different time schedules.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;Layered architecture &lt;/strong&gt;also makes it possible to configure different levels of security to different components deployed on different boxes. sO Layered architecture, enables you to secure portions of the application behind the firewall and make other components accessible from the Internet.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;Layered architecture &lt;/strong&gt;also helps you to test the components independently of each other.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: red; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;The following are the disadvantages of a layered architecture:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;There might be a negative impact &lt;/strong&gt;on the performance as we have the extra overhead of passing through layers instead of calling a component directly.&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;Development of user-intensive&lt;/strong&gt; applications can sometime take longer if the layering prevents the use of user interface components that directly interact with the database.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;The use of layers helps&lt;/strong&gt; to control and encapsulate the complexity of large applications, but adds complexity to simple applications.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;Changes to lower level interfaces &lt;/strong&gt;tend to percolate to higher levels, especially if the relaxed layered approach is used.&lt;/span&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-6926823781058602634?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/6926823781058602634/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2011/03/what-are-advantages-and-disadvantages.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/6926823781058602634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/6926823781058602634'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2011/03/what-are-advantages-and-disadvantages.html' title='What are the advantages and disadvantages of a layered architecture'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-6974553600436848734</id><published>2011-03-10T14:31:00.000-08:00</published><updated>2011-12-01T13:36:51.968-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='difference between layers and tiers'/><title type='text'>What is the difference between layers and tiers</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;Layers&lt;/strong&gt; refer to logical seperation of code. &lt;strong&gt;Logical layers&lt;/strong&gt; help you organise your code better. For example an application can have the following layers.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;1)&lt;/strong&gt;Presentation Layer or UI Layer&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;2)&lt;/strong&gt;Business Layer or Business Logic Layer&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;3)&lt;/strong&gt;Data Access Layer or Data Layer&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;The aboove three &lt;strong&gt;layers&lt;/strong&gt; reside in their own projects, may be 3 projects or even more. When we compile the projects we get the respective layer DLL. So we have 3 DLL's now.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Depending upon how we deploy our application, we may have &lt;strong&gt;1 to 3 tiers&lt;/strong&gt;. As we now have 3 DLL's, if we deploy all the DLL's on the same machine, then we have only &lt;strong&gt;1 physical tier but 3 logical layers.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;If we choose to deploy each DLL on a seperate machine, then we have &lt;strong&gt;3 tiers&lt;/strong&gt; and &lt;strong&gt;3 layers&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;So, &lt;strong&gt;Layers&lt;/strong&gt; are a logical separation and &lt;strong&gt;Tiers&lt;/strong&gt; are a physical separation. We can also say that, &lt;strong&gt;tiers&lt;/strong&gt; are the physical deployment of &lt;strong&gt;layers&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;Tiers:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;1)&lt;/strong&gt; Presenation Tier or UI Tier (Hosts the Presentation Layer or UI Layer). This can be considered as web server in case of an ASP.NET web application. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;2)&lt;/strong&gt; Application Tier or Business Tier (Hosts Business Layer or Business Logic Layer). &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;3)&lt;/strong&gt; Data Access Tier or Data Tier (Hosts Data Access Layer or Data Layer).&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;4)&lt;/strong&gt; Database Tier - SQL Server or Oracle (or any other database) which has tables, stored procedures and other database objects.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;In general the following are the responsibilities of each layer or tier:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;1)&lt;/strong&gt;Presentation Layer or Tier is usually responsible for interacting with the user.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;2)&lt;/strong&gt;Business Layer or Tier is responsible for implementing the business logic of the application.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;3)&lt;/strong&gt;Data Access Layer or Tier is responsible for encapsulating the code that accesses the persistent data stores such as a relational database.&lt;/span&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-6974553600436848734?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/6974553600436848734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2011/03/what-is-difference-between-layers-and.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/6974553600436848734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/6974553600436848734'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2011/03/what-is-difference-between-layers-and.html' title='What is the difference between layers and tiers'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-5022584019340674497</id><published>2010-06-27T06:04:00.000-07:00</published><updated>2011-12-01T13:40:16.332-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='difference between const and static read-only member'/><title type='text'>What is the difference between const and static read-only member?</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;A const field must be initialized at the place where it is declared as shown in the example below.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;class Program&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public const int Number = 100;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;It is a compile time error to declare a const without a value. The code below will generate a compiler error stating "&lt;span style="color: red;"&gt;A const field requires a value to be provided&lt;/span&gt;"&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;class Program&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public const int Number;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;It is a compile time error to change the value of a constant. The following code will generate a compiler error stating "&lt;span style="color: red;"&gt;The left-hand side of an assignment must be a variable, property or indexer&lt;/span&gt;"&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;class Program&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public const int Number = 100;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static void Main()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Number = 200;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;It is not mandatory to initialize a static readonly field where it is declared. You can declare a static readonly field without an initial value and can later initialize the static field in a static constructor as shown below.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;class Program&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static readonly int Number;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static Program()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Number = 100;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;Once a static readonly field is initialized, the value cannot be changed. The code below will generate a compiler error stating "&lt;span style="color: red;"&gt;A static readonly field cannot be assigned to (except in a static constructor or a variable initializer)&lt;/span&gt;"&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;class Program&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static readonly int Number;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static Program()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Number = 100;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static void Main()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Number = 200;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;In short, the difference is that static readonly field can be modified by the containing class, but const field can never be modified and must be initialized where it is declared. A static readonly field can be changed by the containing class using static constructor as shown below.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;class Program&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Initialize the static readonly field &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // to an initial value of 100&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static readonly int Number=100;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static Program()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Value changed to 200 in the static constructor&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Number = 200;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-5022584019340674497?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/5022584019340674497/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2010/06/what-is-difference-between-const-and.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/5022584019340674497'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/5022584019340674497'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2010/06/what-is-difference-between-const-and.html' title='What is the difference between const and static read-only member?'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-3310748947649682389</id><published>2010-06-27T05:55:00.000-07:00</published><updated>2011-12-01T13:41:53.137-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linq Interview Questions'/><title type='text'>LINQ Interview Questions Part 2</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;What are the three main components of LINQ or Language INtegrated Query?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;1.&lt;/strong&gt; Standard Query Operators&lt;/span&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;2.&lt;/strong&gt; Language Extensions &lt;/span&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;3.&lt;/strong&gt; LINQ Providers&lt;/span&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;How are Standard Query Operators implemented in LINQ?&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Standard Query Operators are implemented as extension methods in .NET Framework. These Standard Query Operators can be used to work with any collection of objects that implements the IEnumerable&lt;t&gt; interface. A class that inherits from the IEnumerable&lt;t&gt; interface must provide an enumerator for iterating over a collection of a specific type. All arrays implement IEnumerable&lt;t&gt;. Also, most of the generic collection classes implement IEnumerable&lt;t&gt; interface.&lt;/span&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;How are Standard Query Operators useful in LINQ?&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Standard Query Operators in LINQ can be used for working with collections for any of the following and more.&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;1.&lt;/strong&gt; Get total count of elements in a collection.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;2.&lt;/strong&gt; Order the results of a collection.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;3.&lt;/strong&gt; Grouping.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;4.&lt;/strong&gt; Computing average.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;5.&lt;/strong&gt; Joining two collections based on matching keys.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;6.&lt;/strong&gt; Filter the results&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;List the important language extensions made in C# to make LINQ a reality?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;1.&lt;/strong&gt; Implicitly Typed Variables&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;2.&lt;/strong&gt; Anonymous Types&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;3.&lt;/strong&gt; Object Initializers&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;4.&lt;/strong&gt; Lambda Expressions&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;What is the purpose of LINQ Providers in LINQ?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;LINQ Providers are a set of classes that takes a LINQ query and dynamically generates a method that executes an equivalent query against a specific data source.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;What are the four LINQ Providers that .NET Framework ships?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;1.&lt;/strong&gt; LINQ to Objects - Executes a LINQ query against a collection of objects&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;2.&lt;/strong&gt; LINQ to XML - Executes an XPATH query against XML documents&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;3.&lt;/strong&gt; LINQ to SQL - Executes LINQ queries against Microsoft SQL Server.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;4.&lt;/strong&gt; LINQ to DataSets - Executes LINQ queries against ADO.NET DataSets.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Write a program using LINQ to find the sum of first 5 prime numbers?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;img border="0" height="190" ru="true" src="http://4.bp.blogspot.com/_1pKHzUD_GjE/TCdIOuFk96I/AAAAAAAAACI/UBZqAwd09s4/s640/Program.JPG" width="640" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-3310748947649682389?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/3310748947649682389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2010/06/linq-interview-questions-part-2.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/3310748947649682389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/3310748947649682389'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2010/06/linq-interview-questions-part-2.html' title='LINQ Interview Questions Part 2'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_1pKHzUD_GjE/TCdIOuFk96I/AAAAAAAAACI/UBZqAwd09s4/s72-c/Program.JPG' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-8315842996947053958</id><published>2010-06-19T03:37:00.000-07:00</published><updated>2011-12-01T13:42:37.479-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linq Interview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='what is LINQ'/><category scheme='http://www.blogger.com/atom/ns#' term='advantages of using LINQ or Language INtegrated Query'/><title type='text'>Linq Interview Questions Part 1</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;What is LINQ?&lt;/strong&gt;&lt;/span&gt; &lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;LINQ, or Language INtegrated Query, is a set of classes added to the .NET Framework 3.5. LINQ adds a rich, standardized query syntax to .NET programming languages that allows developers to interact with any type of data.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;What are the advantages of using LINQ or Language INtegrated Query?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;In any data driven application, you get data either from a Database, or an XML file or from collection classes. Prior to LINQ, working with each data source requires writing a different style of code. Moreover, working with external resources like data bases, XML files involves communicating with that external resource in some syntax specific to that resource. To retrieve data from a database you need to send it a string that contains the SQL query to execute, similarly, to work with an XML document involves specifying an XPath expression in the form of a string. The idea is that using LINQ you can work with disparate data sources using a similar style without having to know a separate syntax for communicating with the data source (e.g., SQL or XPath) and without having to resort to passing opaque strings to external resources.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;In any data driven web application or windows application, we use database as a datasource for the application. In order to get data from the database and display it in a web or windows application, we typically do the following.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;1. &lt;strong&gt;Prepare your SQL Statements.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;2. &lt;strong&gt;Execute SQL Statements against the database.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;3. &lt;strong&gt;Retrieve the results.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;4. &lt;strong&gt;Populate the Business Objects.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;5. &lt;strong&gt;Display the Data in the Web Form or Windows From.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_1pKHzUD_GjE/TByefM_JjcI/AAAAAAAAACA/GZ3j_Tmbuzg/s1600/Sample.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="521" qu="true" src="http://4.bp.blogspot.com/_1pKHzUD_GjE/TByefM_JjcI/AAAAAAAAACA/GZ3j_Tmbuzg/s640/Sample.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;In order to send a query to the database we must first establish a connection to the database. We then must encode the logic - the SQL query, its parameters, and the parameters' values - into strings that are supplied to the SqlCommand object. And because these inputs are encoded into opaque strings, there is no compile-time error checking and very limited debugging support. For example, if there is a spelling mistake in the SELECT query causing the Customets table name to be misspelled, this typographical error won't show up until runtime when this page is viewed in a web browser. These typographical errors are easy to make as there is no IntelliSense support. When we use LINQ, Visual Studio would display an error message alerting us about the incorrect table name.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;Another mismatch between the programming language and the database is that the data returned by the database is transformed for us into objects accessible through the SqlDataReader, but these objects are not strongly-typed objects like we'd like. To get this data into strongly-typed objects we must write code ourselves that enumerates the database results and populates each record into a corresponding object. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;LINQ was designed to address all these issues. LINQ also offers a unified syntax for working with data, be it data from a database, an XML file, or a collection of objects. With LINQ you don't need to know the intricacies of SQL, the ins and outs of XPath, or various ways to work with a collection of objects. All you need be familiar with is LINQ's classes and the associated language enhancements centered around LINQ. &lt;/span&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;In other words, LINQ provides type safety, IntelliSense support, compile-time error checking, and enhanced debugging scenarios when working with different datasources.&lt;/span&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-8315842996947053958?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/8315842996947053958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2010/06/linq-interview-questions-part-1.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/8315842996947053958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/8315842996947053958'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2010/06/linq-interview-questions-part-1.html' title='Linq Interview Questions Part 1'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_1pKHzUD_GjE/TByefM_JjcI/AAAAAAAAACA/GZ3j_Tmbuzg/s72-c/Sample.jpg' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-57092004537829710</id><published>2010-01-09T22:56:00.000-08:00</published><updated>2011-12-01T13:43:29.963-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Best pactices in developing asp.net applications'/><title type='text'>Best pactices in developing asp.net applications - Part 2</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;1. Do not catch general exception types - You should not catch Exception or SystemException. Catching generic exception types can hide run-time problems from the library user, and can complicate debugging. You should catch only those exceptions that you can handle gracefully.&lt;br /&gt;&lt;br /&gt;2. Use properties instead of visible instance fields.&lt;br /&gt;&lt;br /&gt;3. Follow the same naming conventions accross the solution. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;&lt;br /&gt;4. Remove unwanted commented code, Indent code properly.&lt;br /&gt;&lt;br /&gt;5. Use curly braces with in an if statement, even if there is a single statement in the if block. This will provide better readability.&lt;br /&gt;&lt;br /&gt;6. Make sure to refactor your code to move the duplicated code to common reusable functions.&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;7. Move one time control settings into the .aspx page rather than having them in the code behind in if(!IsPostback) block.&lt;br /&gt;&lt;br /&gt;8. Use inheritance whereever possible, which enables code reuse and also reduces the amount of code we have to write and test.&lt;br /&gt;&lt;br /&gt;9. Move the reusable javascript functions to an external .js file instead of having them on the page.&lt;br /&gt;&lt;br /&gt;10. For controls that are declarativley specified on the page, tie the event handlers to the controls events on the aspx page rather than initializing them in the codebehind. If the controls are built dynamically then we donot have a choice.&lt;br /&gt;&lt;br /&gt;11. Make sure to check for nulls when using any type retrieved from a session, querystring or a database to avoid NullReferenceExceptions.&lt;br /&gt;&lt;br /&gt;12. Use foreach loop instead of using for loop which may lead to out of boundary run time exceptions.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-57092004537829710?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/57092004537829710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2010/01/best-pactices-in-developing-aspnet_09.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/57092004537829710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/57092004537829710'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2010/01/best-pactices-in-developing-aspnet_09.html' title='Best pactices in developing asp.net applications - Part 2'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-1659242043789643487</id><published>2010-01-09T22:43:00.000-08:00</published><updated>2011-12-01T13:44:19.286-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Best pactices in developing asp.net applications'/><title type='text'>Best pactices in developing asp.net applications - Part 1</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;1. Remove unused private fields and functions.&lt;br /&gt;&lt;br /&gt;2. Do not cast unnecessarily. Avoid duplicate casts where possible, since there is a cost associated with them.&lt;br /&gt;&lt;br /&gt;3. Properties that return arrays are prone to code inefficiencies. Consider using a collection or making this a method.&lt;br /&gt;&lt;br /&gt;4. To test for empty strings, check if String.Length is equal to zero. Constructs such as "".Equals(someString) and String.Empty.Equals(someString) are less efficient than testing the string length. Replace these with checks for someString.Length == 0.&lt;br /&gt;&lt;br /&gt;5. Methods in the same type that differ only by return type can be difficult for developers and tools to properly recognize. When extending a type, be sure not to define new methods that differ from base type methods only by type.&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;6. Use stringbuilder instead of string types for string manipulation. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;&lt;br /&gt;7. Use String.Format instead of concatenating and appending strings.&lt;br /&gt;&lt;br /&gt;8. Use Type.TryParse rather than Convert.ToDestinationType(). For example use int.TryParse() rather than Convert.ToInt32() which might throw an exception.&lt;br /&gt;&lt;br /&gt;9. Override Equals() method wherever applicable in your classes.&lt;br /&gt;&lt;br /&gt;10. Consider passing base types as parameters - Using base types as parameters to methods improves re-use of these methods if you only use methods &amp;amp; properties from the parameter's base class. E.g. use Stream instead of FileStream as a parameter when only calling Stream.Read(), this makes the method work on all kind of streams instead of just File streams. &lt;somelength;&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-1659242043789643487?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/1659242043789643487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2010/01/best-pactices-in-developing-aspnet.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/1659242043789643487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/1659242043789643487'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2010/01/best-pactices-in-developing-aspnet.html' title='Best pactices in developing asp.net applications - Part 1'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-4497968975215398097</id><published>2009-01-17T17:45:00.000-08:00</published><updated>2011-12-01T13:45:06.734-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='script injection'/><category scheme='http://www.blogger.com/atom/ns#' term='sql injection'/><category scheme='http://www.blogger.com/atom/ns#' term='secure connection strings'/><category scheme='http://www.blogger.com/atom/ns#' term='htmlencode'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET Interview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='Data Access Security'/><title type='text'>ASP.NET Interview Questions on Data Access Security</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;&lt;strong&gt;What are the best practices to follow to secure connection strings in an ASP.NET web application?&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;1. &lt;/strong&gt;Always store connection strings in the site's Web.config file. Web.config is very secure. Users will not be able to access web.config from the browser.&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; Do not store connection strings as plain text. To help keep the connection to your database server secure, it is recommended that you encrypt connection string information in the configuration file.&lt;br /&gt;&lt;strong&gt;3.&lt;/strong&gt; Never store connection strings in an aspx page.&lt;br /&gt;&lt;strong&gt;4. &lt;/strong&gt;Never set connection strings as declarative properties of the SqlDataSource control or other data source controls.&lt;/span&gt;&lt;span style="font-family: arial;"&gt;&lt;strong&gt;Why is "Connecting to SQL Server using Integrated Security" considered a best practice?&lt;/strong&gt;Connecting to SQL Server using integrated security instead of using an explicit user name and password, helps avoid the possibility of the connection string being compromised and your user ID and password being exposed.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the advantage of storing an XML file in the applications App_Data folder? &lt;/strong&gt;&lt;br /&gt;The contents of the App_Data folder will not be returned in response to direct HTTP requests.&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;strong&gt;What is Script injection? &lt;/strong&gt;&lt;br /&gt;A script injection attack attempts to send executable script to your application with the intent of having other users run it. A typical script injection attack sends script to a page that stores the script in a database, so that another user who views the data inadvertently runs the code.&lt;/span&gt;&lt;span style="font-family: arial;"&gt;&lt;strong&gt;What is SQL injection?&lt;/strong&gt;A SQL injection attack attempts to compromise your database by creating SQL commands that are executed instead of, or in addition to, the commands that you have built into your application.&lt;/span&gt;&lt;span style="font-family: arial;"&gt;&lt;strong&gt;What are the best practices to keep in mind when accepting user input on a web application?&lt;br /&gt;1.&lt;/strong&gt; Always use validation controls whenever possible to limit user input to acceptable values.&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; Always check the IsValid property of the aspx page. Run the server side code only if the IsValid property value is true. A value of false means that one or more validation controls have failed a validation check.&lt;br /&gt;&lt;strong&gt;3.&lt;/strong&gt; Always perform server side validation irrespective of client side validation being performed or not. This will protect your web application even if the client has by passed the client side validation by disabling javascript in the web browser.&lt;br /&gt;&lt;strong&gt;4. &lt;/strong&gt;Also make sure to re validate user input in the business logic layer of your application.&lt;/span&gt;&lt;span style="font-family: arial;"&gt;&lt;strong&gt;What are the steps to follow to avoid Script Injection attacks?&lt;br /&gt;1.&lt;/strong&gt; Encode user input with the HtmlEncode method. This method turns HTML into its text representation.&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; If you are using the GridView control with bound fields, set the BoundField object's HtmlEncode property to true. This causes the GridView control to encode user input when the row is in edit mode.&lt;/span&gt;&lt;span style="font-family: arial;"&gt;&lt;strong&gt;What are the steps to follow to avoid SQL Injection attacks?&lt;/strong&gt;Always use parameterized queries or stored procedures instead of creating SQL commands by concatenating strings together.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Can you encrypt view state data of an aspx page? &lt;/strong&gt;&lt;br /&gt;Yes, you encrypt view state data of an aspx page by setting the page's ViewStateEncryptionMode property to true.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-4497968975215398097?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/4497968975215398097/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2009/01/aspnet-interview-questions-on-data.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/4497968975215398097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/4497968975215398097'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2009/01/aspnet-interview-questions-on-data.html' title='ASP.NET Interview Questions on Data Access Security'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-5137975408394835075</id><published>2008-11-26T11:43:00.000-08:00</published><updated>2011-12-01T13:45:40.355-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DirectoryInfo'/><category scheme='http://www.blogger.com/atom/ns#' term='directory explorer'/><category scheme='http://www.blogger.com/atom/ns#' term='folders'/><category scheme='http://www.blogger.com/atom/ns#' term='FileInfo'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET Interview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='List all the files in a directory on a web form in asp.net'/><title type='text'>List all the files in a directory on a web form in asp.net</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;&lt;strong&gt;Question : &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;List all the files in a directory &lt;/strong&gt;on a web form. The files must be displayed in a gridview control. The name of the file and create date must be displayed.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Answer:&lt;br /&gt;1.&lt;/strong&gt; Create a new web form. Drag and drop a gridview control from the toolbox onto the webform.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; Create 2 bound fields for the gridview. One bound field will display the file name and the other will display the create date.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3.&lt;/strong&gt; The HTML for your web form should be as shown below.&lt;br /&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="ListFiles.aspx.cs" Inherits="ListFiles" %&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head runat="server"&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;List all the files in a directory&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"&amp;gt;&lt;br /&gt;&amp;lt;Columns&amp;gt;&lt;br /&gt;&amp;lt;asp:BoundField DataField="FileName" HeaderText="File Name"&amp;gt;&amp;lt;/asp:BoundField&amp;gt;&lt;br /&gt;&amp;lt;asp:BoundField DataField="DateCreated" HeaderText="Date" DataFormatString="{0:d}"&amp;gt;&amp;lt;/asp:BoundField&amp;gt;&lt;br /&gt;&amp;lt;/Columns&amp;gt;&lt;br /&gt;&amp;lt;/asp:GridView&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4.&lt;/strong&gt; In the code behind file write a function which can &lt;strong&gt;get the list of files from the directory and bind to the gridview&lt;/strong&gt;. The function is as shown below.&lt;br /&gt;private void LoadFiles()&lt;br /&gt;{&lt;br /&gt;/* Create an instance of DirectoryInfo class for enumarating through the directory. */&lt;br /&gt;System.IO.DirectoryInfo dirInfo = new System.IO.DirectoryInfo(Server.MapPath("FilesDirectory"));&lt;br /&gt;/* Call the GetFiles() instance method of the DirectoryInfo class object, which will return a files list from the current directory */&lt;br /&gt;System.IO.FileInfo[] fiFiles = dirInfo.GetFiles();&lt;br /&gt;/* Create a DataTable which can be used as the datasource for the gridview */&lt;br /&gt;DataTable dtFileList = new DataTable("Files");&lt;br /&gt;/* Create a DataColumn for file name */&lt;br /&gt;DataColumn dcFileName = new DataColumn("FileName");&lt;br /&gt;/* Create a DataColumn for file create date */&lt;br /&gt;DataColumn dcDateCreated = new DataColumn("DateCreated", typeof(DateTime));&lt;br /&gt;/* Add the 2 data columns to the data table */&lt;br /&gt;dtFileList.Columns.Add(dcFileName);&lt;br /&gt;dtFileList.Columns.Add(dcDateCreated);&lt;br /&gt;/* Now loop through each FileInfo object and get the file name and file create date */&lt;br /&gt;foreach (System.IO.FileInfo f in fiFiles)&lt;br /&gt;{&lt;br /&gt;DataRow dtNewRow = dtFileList.NewRow();&lt;br /&gt;/* Get the file name using FileInfo object "Name" property */&lt;br /&gt;dtNewRow["FileName"] = f.Name.ToString();&lt;br /&gt;/* Get the file create date and time using FileInfo object "CreationTime" property */&lt;br /&gt;dtNewRow["DateCreated"] = f.CreationTime.ToShortDateString();&lt;br /&gt;/* Add the row to the DataTable */&lt;br /&gt;dtFileList.Rows.Add(dtNewRow);&lt;br /&gt;}&lt;br /&gt;/* Set the datatable as the DataSource for the gridview and call the DataBind() method */&lt;br /&gt;GridView1.DataSource = dtFileList;&lt;br /&gt;GridView1.DataBind();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5.&lt;/strong&gt; Finally call the LoadFiles() method on the page load event handler as shown below.&lt;br /&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;LoadFiles();&lt;br /&gt;}&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;strong&gt;Testing the application:&lt;br /&gt;1.&lt;/strong&gt; Right click on the project name in solution explorer, and left click on "NewFolder"&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; Rename the "NewFolder" to "FilesDirectory"&lt;br /&gt;&lt;strong&gt;3.&lt;/strong&gt; Drag and Drop some files into the directoy.&lt;br /&gt;&lt;strong&gt;4.&lt;/strong&gt; Then run the application. All the files in the "FilesDirectory" folder will be shown in the gridview.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-5137975408394835075?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/5137975408394835075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2008/11/list-all-files-in-directory-on-web-form.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/5137975408394835075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/5137975408394835075'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2008/11/list-all-files-in-directory-on-web-form.html' title='List all the files in a directory on a web form in asp.net'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-1292863450615902268</id><published>2008-11-26T11:36:00.000-08:00</published><updated>2011-12-01T13:46:38.572-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Write and Read a cookie'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET Interview Questions'/><title type='text'>Write and Read a cookie - ASP.NET Interview Questions</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;&lt;strong&gt;Question:&lt;/strong&gt;Give an example to show how to write and read a cookie from a client's computer.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Answer: &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;1.&lt;/strong&gt; The following example shows how to write a "USER" cookie to a client's computer. The "USER" cookie, stores&lt;br /&gt;&lt;strong&gt;FirstName&lt;br /&gt;LastName&lt;br /&gt;LastVisit &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; Create the user interface to enter FirstName and LastName. The HTML for the webform is as shown below.&lt;br /&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="CookiesExample.aspx.cs" Inherits="CookiesExample" %&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head runat="server"&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Write a cookie to the client computer&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;table&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td style="width: 100px"&amp;gt;&lt;br /&gt;First Name&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td style="width: 100px"&amp;gt;&lt;br /&gt;&amp;lt;asp:TextBox ID="FirstNameTextBox" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td style="width: 100px"&amp;gt;&lt;br /&gt;Last Name&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td style="width: 100px"&amp;gt;&lt;br /&gt;&amp;lt;asp:TextBox ID="LastNameTextBox" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td style="width: 100px"&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td style="width: 100px"&amp;gt;&lt;br /&gt;&amp;lt;asp:Button ID="WriteCookieButton" runat="server" Text="Write Cookie" OnClick="WriteCookieButton_Click" /&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td style="width: 100px"&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td style="width: 100px"&amp;gt;&lt;br /&gt;&amp;lt;asp:Button ID="ReadCookieButton" runat="server" Text="Read Cookie" OnClick="ReadCookieButton_Click" /&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;strong&gt;3.&lt;/strong&gt; &lt;strong&gt;WriteCookieButton_Click &lt;/strong&gt;event handler in the code behind file, has the code required to &lt;strong&gt;write the cookie &lt;/strong&gt;to the client computer as shown below.&lt;br /&gt;protected void WriteCookieButton_Click(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;// Create an instance of HttpCookie class&lt;br /&gt;HttpCookie UserCookie = new HttpCookie("USER");&lt;br /&gt;// Populate FirstName, LastName and LastVisit fields&lt;br /&gt;UserCookie["FirstName"] = FirstNameTextBox.Text;&lt;br /&gt;UserCookie["LastName"] = LastNameTextBox.Text;&lt;br /&gt;UserCookie["LastVisit"] = DateTime.Now.ToString();&lt;br /&gt;// Set the cookie expiration date&lt;br /&gt;UserCookie.Expires = DateTime.Now.AddDays(3);&lt;br /&gt;// Write the cookie to the client computer&lt;br /&gt;Response.Cookies.Add(UserCookie);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4.&lt;/strong&gt; ReadCookieButton_Click even handler in the code behind file has the code to &lt;strong&gt;read the cookie &lt;/strong&gt;from the client computer as shown below.&lt;br /&gt;protected void ReadCookieButton_Click(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;// Check if the "USER" cookie exists on the client computer&lt;br /&gt;if (Request.Cookies["USER"] != null)&lt;br /&gt;{&lt;br /&gt;//Retrieve the "USER" cookie into a cookie object&lt;br /&gt;HttpCookie UserCookie = Request.Cookies["USER"];&lt;br /&gt;//Write FirstName,LastName and LastVisit values&lt;br /&gt;Response.Write("First Name = " + UserCookie["FirstName"] + "&lt;br /&gt;");&lt;br /&gt;Response.Write("Last Name = " + UserCookie["LastName"] + "&lt;br /&gt;");&lt;br /&gt;Response.Write("Last Visit = " + UserCookie["LastVisit"] + "&lt;br /&gt;");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5.&lt;/strong&gt; Finally test. Run the application and enter first name and Last name and click, the &lt;strong&gt;write cookie &lt;/strong&gt;button. This should &lt;strong&gt;write the cookie &lt;/strong&gt;to the client's computer. Now click the &lt;strong&gt;read cookie &lt;/strong&gt;button, which will read the FirstName, LastName and LastVisit information from the cookie and writes on to the webform.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-1292863450615902268?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/1292863450615902268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2008/11/write-and-read-cookie-aspnet-interview.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/1292863450615902268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/1292863450615902268'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2008/11/write-and-read-cookie-aspnet-interview.html' title='Write and Read a cookie - ASP.NET Interview Questions'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-1523441004672587766</id><published>2008-11-24T16:07:00.000-08:00</published><updated>2011-12-01T13:47:20.931-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='difference between asynchronous and synchronous HTTP Handlers'/><category scheme='http://www.blogger.com/atom/ns#' term='IHttpAsyncHandler'/><category scheme='http://www.blogger.com/atom/ns#' term='IHttpHandler'/><category scheme='http://www.blogger.com/atom/ns#' term='HTTP module'/><category scheme='http://www.blogger.com/atom/ns#' term='custom HTTP handler factory'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET Interview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='HTTP Handler'/><title type='text'>ASP.NET Interview Questions on HTTP modules and HTTP Handlers</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;&lt;strong&gt;&lt;br /&gt;What is an HTTP Handler? &lt;/strong&gt;&lt;br /&gt;An ASP.NET &lt;strong&gt;HTTP handler &lt;/strong&gt;is the process (frequently referred to as the "endpoint") that runs in response to a request made to an ASP.NET Web application. The most common handler is an ASP.NET page handler that processes .aspx files. When users request an .aspx file, the request is processed by the page through the page handler. You can create your own HTTP handlers that render custom output to the browser.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is HTTP module?&lt;/strong&gt;An &lt;strong&gt;HTTP module&lt;/strong&gt; is an assembly that is called on every request that is made to your application. HTTP modules are called as part of the ASP.NET request pipeline and have access to life-cycle events throughout the request. HTTP modules let you examine incoming and outgoing requests and take action based on the request.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the interface that you have to implement if you have to create a Custom HTTP Handler? &lt;/strong&gt;&lt;br /&gt;Implement &lt;strong&gt;IHttpHandler&lt;/strong&gt; interface to create a synchronous handler.&lt;br /&gt;Implement &lt;strong&gt;IHttpAsyncHandler &lt;/strong&gt;to create an asynchronous handler.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the difference between asynchronous and synchronous HTTP Handlers?&lt;/strong&gt;A &lt;strong&gt;synchronous handler &lt;/strong&gt;does not return until it finishes processing the HTTP request for which it is called.&lt;br /&gt;&lt;br /&gt;An &lt;strong&gt;asynchronous handler&lt;/strong&gt; runs a process independently of sending a response to the user. Asynchronous handlers are useful when you must start an application process that might be lengthy and the user does not have to wait until it finishes before receiving a response from the server.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Which class is responsible for receiving and forwarding a request to the appropriate HTTP handler? &lt;/strong&gt;&lt;br /&gt;IHttpHandlerFactory Class&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;strong&gt;Can you create your own custom HTTP handler factory class?&lt;/strong&gt;&lt;br /&gt;Yes, we can create a custom &lt;strong&gt;HTTP handler &lt;/strong&gt;factory class by creating a class that implements the IHttpHandlerFactory interface.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the use of HTTP modules? &lt;/strong&gt;&lt;br /&gt;HTTP modules are used to implement various application features, such as forms authentication, caching, session state, and client script services.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the difference between HTTP modules and HTTP handlers?&lt;/strong&gt;An &lt;strong&gt;HTTP handler&lt;/strong&gt; returns a response to a request that is identified by a file name extension or family of file name extensions. In contrast, an HTTP module is invoked for all requests and responses. It subscribes to event notifications in the request pipeline and lets you run code in registered event handlers. The tasks that a module is used for are general to an application and to all requests for resources in the application.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the common way to register an HTTP module?&lt;/strong&gt;The common way to register an HTTP module is to have an entry in the application's Web.config file.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Much of the functionality of a module can be implemented in a global.asax file. When do you create an HTTP module over using Global.asax File? &lt;/strong&gt;&lt;br /&gt;You create an &lt;strong&gt;HTTP module&lt;/strong&gt; over using Global.asax file if the following conditions are true&lt;br /&gt;&lt;br /&gt;1. You want to re-use the module in other applications.&lt;br /&gt;2. You want to avoid putting complex code in the Global.asax file.&lt;br /&gt;3. The module applies to all requests in the pipeline.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-1523441004672587766?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/1523441004672587766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2008/11/aspnet-interview-questions-on-http.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/1523441004672587766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/1523441004672587766'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2008/11/aspnet-interview-questions-on-http.html' title='ASP.NET Interview Questions on HTTP modules and HTTP Handlers'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-7971800732110345128</id><published>2008-11-22T18:31:00.000-08:00</published><updated>2011-12-01T13:48:10.179-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='default skin'/><category scheme='http://www.blogger.com/atom/ns#' term='global theme'/><category scheme='http://www.blogger.com/atom/ns#' term='difference between themes and CSS'/><category scheme='http://www.blogger.com/atom/ns#' term='Named skin'/><category scheme='http://www.blogger.com/atom/ns#' term='What is a theme'/><title type='text'>ASP.NET Interview Questions on Themes and Skins</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;strong&gt;What is a "theme" in ASP.NET?&lt;br /&gt;&lt;/strong&gt;A "theme" is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in a Web application, across an entire Web application, or across all Web applications on a server.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the extension for a skin file? &lt;/strong&gt;&lt;br /&gt;.skin&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;strong&gt;What are the 2 types of control skins in ASP.NET?&lt;br /&gt;1. &lt;/strong&gt;Default skins&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; Named skins&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;strong&gt;What is the difference between Named skins and Default skins?&lt;br /&gt;&lt;/strong&gt;A &lt;strong&gt;default skin&lt;/strong&gt; automatically applies to all controls of the same type when a theme is applied to a page. A control skin is a default skin if it does not have a SkinID attribute. For example, if you create a default skin for a Calendar control, the control skin applies to all Calendar controls on pages that use the theme. (Default skins are matched exactly by control type, so that a Button control skin applies to all Button controls, but not to LinkButton controls or to controls that derive from the Button object.)&lt;br /&gt;&lt;br /&gt;A &lt;strong&gt;named skin&lt;/strong&gt; is a control skin with a SkinID property set. Named skins do not automatically apply to controls by type. Instead, you explicitly apply a named skin to a control by setting the control's SkinID property. Creating named skins allows you to set different skins for different instances of the same control in an application.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;strong&gt;What are the 3 levels at which a theme can be applied for a web application?&lt;br /&gt;1&lt;/strong&gt;. At the page level - Use the Theme or StyleSheetTheme attribute of the @ Page directive.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; At the application level - Can be applied to all pages in an application by setting the &amp;lt;pages&amp;gt; element in the application configuration file.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3.&lt;/strong&gt; At the web server level - Define the &amp;lt;pages&amp;gt; element in machine.config file. This will apply the theme to all the web applications on that web server.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;strong&gt;What is the name of the folder that contains the application themes?&lt;br /&gt;&lt;/strong&gt;App_Themes&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;strong&gt;What is a global theme? &lt;/strong&gt;&lt;br /&gt;A &lt;strong&gt;global theme &lt;/strong&gt;is a theme that you can apply to all the Web sites on a server. Global themes allow you to define an overall look for your domain when you maintain multiple Web sites on the same server.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the difference between themes and CSS? &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;1.&lt;/strong&gt; Themes can define many properties of a control or page, not just style properties. For example, using themes, you can specify the graphics for a TreeView control, the template layout of a GridView control, and so on.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; Themes can include graphics.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3.&lt;/strong&gt; Themes do not cascade the way style sheets do. By default, any property values defined in a theme referenced by a page's Theme property override the property values declaratively set on a control, unless you explicitly apply the theme using the StyleSheetTheme property.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. &lt;/strong&gt;Only one theme can be applied to each page. You cannot apply multiple themes to a page, unlike style sheets where multiple style sheets can be applied.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;strong&gt;What are the security concerns to keep in mind when using themes?&lt;br /&gt;&lt;/strong&gt;Themes can cause security issues when they are used on your Web site. Malicious themes can be used to:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1.&lt;/strong&gt; Alter a control's behavior so that it does not behave as expected.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; Inject client-side script, therefore posing a cross-site scripting risk.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3.&lt;/strong&gt; Expose sensitive information.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. &lt;/strong&gt;The mitigations for these common threats are:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5.&lt;/strong&gt; Protect the global and application theme directories with proper access control settings. Only trusted users should be allowed to write files to the theme directories.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;6. &lt;/strong&gt;Do not use themes from an untrusted source. Always examine any themes from outside your organization for malicious code before using them on you Web site.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;7.&lt;/strong&gt; Do not expose the theme name in query data. Malicious users could use this information to use themes that are unknown to the developer and thereby expose sensitive information.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-7971800732110345128?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/7971800732110345128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2008/11/aspnet-interview-questions-on-themes.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/7971800732110345128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/7971800732110345128'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2008/11/aspnet-interview-questions-on-themes.html' title='ASP.NET Interview Questions on Themes and Skins'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-6400636966191457384</id><published>2008-11-22T17:59:00.000-08:00</published><updated>2011-12-01T13:48:53.679-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Reading and writing to an XML file'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET Interview Questions'/><title type='text'>Reading and writing to an XML file.</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;strong&gt;Question:&lt;br /&gt;&lt;/strong&gt;Create a simple web page, that can read and write to an XML file. The XML file has a list of email ids. The sample web form should have the following functionality. You have 30 minutes to code and test.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1.&lt;/strong&gt; A TextBox to accept a valid email id.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; A submit button. When you click the submit button, the email id entered in the TextBox must be saved to the XML file.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3.&lt;/strong&gt; If I donot enter anything in the TextBox and click the submit button, the application should show a validation message stating "Email is required".&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4.&lt;/strong&gt; If I enter an invalid email, the application should show a message "Invalid Email".&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5.&lt;/strong&gt; If javascript is enabled the validation should happen on the client browser without postback. If javascript is disabled the validation should happen on the web server.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;6.&lt;/strong&gt; Finally we should have a list box, which will show all the existing email ids in the XML file. When you submit a new email, the listbox should be reloaded showing the newly added email along with already existing email ids.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Answer: &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;1.&lt;/strong&gt; Create a webform and add a TextBox, RequiredFieldValidator, RegularExpressionValidator, Button and a ListBox.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; Set the RequiredFieldValidator "ErrorMessage" property to "Email Required" and "ControlToValidate" property to "EmailTextBox" and "Display" property to "Dynamic" as shown below.&lt;br /&gt;&amp;lt;asp:RequiredFieldValidator ID="EmailRequiredFieldValidator" runat="server" ErrorMessage="Email Required" ControlToValidate="EmailTextBox" Display="Dynamic"&amp;gt;&amp;lt;/asp:RequiredFieldValidator&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3.&lt;/strong&gt; Set the RegularExpressionValidator "ErrorMessage" property to "Invalid Email" and "ControlToValidate" property to "EmailTextBox" and "Display" property to "Dynamic" as shown below.&lt;br /&gt;&amp;lt;asp:RegularExpressionValidator ID="EmailRegularExpressionValidator" runat="server" ErrorMessage="Invalid Email" ControlToValidate="EmailTextBox" Display="Dynamic" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"&amp;gt;&amp;lt;/asp:RegularExpressionValidator&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4.&lt;/strong&gt; Set the ListBox, "DataTextField" property to "Email" and DataValueField property to "Email"&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5.&lt;/strong&gt; The complete HTML of the web form should be as shown below.&lt;br /&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head runat="server"&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Email List&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;table&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&lt;br /&gt;Please enter a valid email:&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&lt;br /&gt;&amp;lt;asp:TextBox ID="EmailTextBox" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&lt;br /&gt;&amp;lt;asp:RequiredFieldValidator ID="EmailRequiredFieldValidator" runat="server" ErrorMessage="Email Required" ControlToValidate="EmailTextBox" Display="Dynamic"&amp;gt;&amp;lt;/asp:RequiredFieldValidator&amp;gt;&lt;br /&gt;&amp;lt;asp:RegularExpressionValidator ID="EmailRegularExpressionValidator" runat="server" ErrorMessage="Invalid Email" ControlToValidate="EmailTextBox" Display="Dynamic" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"&amp;gt;&amp;lt;/asp:RegularExpressionValidator&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&lt;br /&gt;&amp;lt;asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Submit" /&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;Existing Email Ids&lt;br /&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;asp:ListBox ID="ListBox1" runat="server" Height="292px" Width="192px" DataTextField="Email" DataValueField="Email"&amp;gt;&amp;lt;/asp:ListBox&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;6.&lt;/strong&gt; Place the XML file that contains the list of email ids in the root folder of the web application. The sample XML file is shown below.&lt;br /&gt;&amp;lt;?xml version="1.0" standalone="yes"?&amp;gt;&lt;br /&gt;&amp;lt;EmailsList&amp;gt;&lt;br /&gt;&amp;lt;Emails&amp;gt;&lt;br /&gt;&amp;lt;Email&amp;gt;dhex@yahoo.com&amp;lt;/Email&amp;gt;&lt;br /&gt;&amp;lt;/Emails&amp;gt;&lt;br /&gt;&amp;lt;Emails&amp;gt;&lt;br /&gt;&amp;lt;Email&amp;gt;dmexy@aol.com&amp;lt;/Email&amp;gt;&lt;br /&gt;&amp;lt;/Emails&amp;gt;&lt;br /&gt;&amp;lt;Emails&amp;gt;&lt;br /&gt;&amp;lt;Email&amp;gt;dpitt@gmail.com&amp;lt;/Email&amp;gt;&lt;br /&gt;&amp;lt;/Emails&amp;gt;&lt;br /&gt;&amp;lt;Emails&amp;gt;&lt;br /&gt;&amp;lt;Email&amp;gt;mston@microsoft.com&amp;lt;/Email&amp;gt;&lt;br /&gt;&amp;lt;/Emails&amp;gt;&lt;br /&gt;&amp;lt;/EmailsList&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;7.&lt;/strong&gt; In the code behind file, write a function the can read the email ids from the XML file into a DataSet. Set this DataSet as the DataSource for the ListBox and call the DataBind() method. The function should be as shown below.&lt;br /&gt;private void LoadExistingEmails()&lt;br /&gt;{&lt;br /&gt;DataSet DS = new DataSet();&lt;br /&gt;DS.ReadXml(Server.MapPath("Emails.xml"));&lt;br /&gt;&lt;br /&gt;ListBox1.DataSource = DS;&lt;br /&gt;ListBox1.DataBind();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;8.&lt;/strong&gt; Call the above LoadExistingEmails() function in the Page_Load event handler as shown in the sample code below.&lt;br /&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;LoadExistingEmails();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;9.&lt;/strong&gt; Finally, when you click the submit button write to the XML file as shown below.&lt;br /&gt;protected void Button1_Click(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;if (Page.IsValid)&lt;br /&gt;{&lt;br /&gt;DataSet DS = new DataSet();&lt;br /&gt;DS.ReadXml(Server.MapPath("Emails.xml"));&lt;br /&gt;&lt;br /&gt;DataRow DR = DS.Tables[0].NewRow();&lt;br /&gt;DR["Email"] = EmailTextBox.Text;&lt;br /&gt;&lt;br /&gt;DS.Tables[0].Rows.Add(DR);&lt;br /&gt;&lt;br /&gt;DS.WriteXml(Server.MapPath("Emails.xml"));&lt;br /&gt;LoadExistingEmails();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Points to remember:&lt;br /&gt;1.&lt;/strong&gt; Validation controls work both on the client and on the server.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; If javascript is enabled validations happen on the client browser without posting the page back to the server.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3.&lt;/strong&gt; If javascript is disabled, validations happen on the server. To check if all the validation controls haved passed validation, use Page.IsValid property.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4.&lt;/strong&gt; Page.IsValid returns "true" if the page has succeeded validation and "false" even if a single validation control has filed validation.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5.&lt;/strong&gt; In our example, we write to the XML file only if Page.IsValid property returns true.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Testing the sample application:&lt;br /&gt;&lt;/strong&gt;To test if the validation controls are working on the server, disable javascript on the client browser. To disable javascript on the client browser follow the below steps.&lt;br /&gt;&lt;strong&gt;1.&lt;/strong&gt; Open internet explorer.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; Click on Tools.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3.&lt;/strong&gt; Click on Internet Options. You will see Internet Options dialog page.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4.&lt;/strong&gt; Click on the Security tab.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5.&lt;/strong&gt; On the Security tab, select Local intranet under Select a zone to view or change security settings.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;6.&lt;/strong&gt; Click "Custom Level" button under "Security Level for this zone"&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;7.&lt;/strong&gt; On the "Security Setting - Local Intranet Zone" dialog page, scroll down to "Scripting" section.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;8.&lt;/strong&gt; Select "Disable" radio button under "Active scription" and click "OK" button.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-6400636966191457384?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/6400636966191457384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2008/11/reading-and-writing-to-xml-file.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/6400636966191457384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/6400636966191457384'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2008/11/reading-and-writing-to-xml-file.html' title='Reading and writing to an XML file.'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-3708452382160905652</id><published>2008-11-20T16:28:00.000-08:00</published><updated>2011-12-01T13:49:42.903-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET Interview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='write a custom reusable function to populate a dropdownlist'/><title type='text'>write a custom reusable function to populate a dropdownlist</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;span&gt;&lt;br /&gt;&lt;strong&gt;Write a custom function in c-sharp. The custom function parameters should be an instance of a dropdownlist, an xml file and a string. &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;1.&lt;/strong&gt; The function should be capabale of populating the passed in dropdownlist.&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; The first item in the dropdownlist should be the passed in string parameter.&lt;br /&gt;&lt;strong&gt;3.&lt;/strong&gt; The data for the dropdownlist comes from the passed in XML file.&lt;br /&gt;&lt;br /&gt;The idea is to create a custom function which can be reused through out the project for populating any dropdownlist on any web page. You have 20 minutes to code, test and demonstrate.&lt;br /&gt;&lt;br /&gt;The sample code for custom function is shown below. For this example to work drop the XML file in the root folder of the web application.&lt;br /&gt;&lt;br /&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;PopulateDropdownlist(DropDownList1, "DropDownListSource.xml", "Select State");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void PopulateDropdownlist(System.Web.UI.WebControls.DropDownList DropDownListObjectToBePopulated,string XMLFilePath, string InitialString)&lt;br /&gt;{&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;DataSet DS = new DataSet();&lt;br /&gt;DS.ReadXml(Server.MapPath(XMLFilePath));&lt;br /&gt;if (InitialString != string.Empty)&lt;br /&gt;{&lt;br /&gt;ListItem LI = new ListItem(InitialString, "-1");&lt;br /&gt;DropDownListObjectToBePopulated.Items.Add(LI);&lt;br /&gt;}&lt;br /&gt;foreach (DataRow DR in DS.Tables["State"].Rows)&lt;br /&gt;{&lt;br /&gt;ListItem LI = new ListItem();&lt;br /&gt;LI.Text = DR["StateName"].ToString();&lt;br /&gt;LI.Value = DR["StateCode"].ToString();&lt;br /&gt;DropDownListObjectToBePopulated.Items.Add(LI);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;catch(Exception Ex)&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The XML file that has the data for the dropdownlist is as shown below.&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&lt;br /&gt;&amp;lt;StatesList&amp;gt;&lt;br /&gt;&amp;lt;State&amp;gt;&lt;br /&gt;&amp;lt;StateName&amp;gt;Virginia&amp;lt;/StateName&amp;gt;&lt;br /&gt;&amp;lt;StateCode&amp;gt;VA&amp;lt;/StateCode&amp;gt;&lt;br /&gt;&amp;lt;/State&amp;gt;&lt;br /&gt;&amp;lt;State&amp;gt;&lt;br /&gt;&amp;lt;StateName&amp;gt;Iowa&amp;lt;/StateName&amp;gt;&lt;br /&gt;&amp;lt;StateCode&amp;gt;IA&amp;lt;/StateCode&amp;gt;&lt;br /&gt;&amp;lt;/State&amp;gt;&lt;br /&gt;&amp;lt;State&amp;gt;&lt;br /&gt;&amp;lt;StateName&amp;gt;North Carolina&amp;lt;/StateName&amp;gt;&lt;br /&gt;&amp;lt;StateCode&amp;gt;NC&amp;lt;/StateCode&amp;gt;&lt;br /&gt;&amp;lt;/State&amp;gt;&lt;br /&gt;&amp;lt;State&amp;gt;&lt;br /&gt;&amp;lt;StateName&amp;gt;Pennsylvania&amp;lt;/StateName&amp;gt;&lt;br /&gt;&amp;lt;StateCode&amp;gt;PA&amp;lt;/StateCode&amp;gt;&lt;br /&gt;&amp;lt;/State&amp;gt;&lt;br /&gt;&amp;lt;State&amp;gt;&lt;br /&gt;&amp;lt;StateName&amp;gt;Texas&amp;lt;/StateName&amp;gt;&lt;br /&gt;&amp;lt;StateCode&amp;gt;TX&amp;lt;/StateCode&amp;gt;&lt;br /&gt;&amp;lt;/State&amp;gt;&lt;br /&gt;&amp;lt;/StatesList&amp;gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;strong&gt;Explanation of the code:&lt;br /&gt;1.&lt;/strong&gt; PopulateDropdownlist function has 3 parameters. DropDownList to be populated, the path of the XML file which has the data for the dropdownlist and the initial string.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; Create an instance of DataSet. In our example the instance is DS.&lt;br /&gt;&lt;strong&gt;DataSet DS = new DataSet();&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;3.&lt;/strong&gt; Read the XML data into the dataset instance using ReadXml() method. Pass the path of the XML file to ReadXml() method. We used Server.MapPath() method to return the physical file path that corresponds to the specified virtual path on the web server.&lt;br /&gt;&lt;strong&gt;DS.ReadXml(Server.MapPath(XMLFilePath));&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;4.&lt;/strong&gt; We now have the data from the XML file in the dataset as a DataTable.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5.&lt;/strong&gt; Check if the InitialString is empty. If not empty create a new ListItem object and populate the Text and Value properties. Then add the listitem object to the dropdownlist.&lt;br /&gt;&lt;strong&gt;if (InitialString != string.Empty)&lt;br /&gt;{&lt;br /&gt;ListItem LI = new ListItem(InitialString, "-1");&lt;br /&gt;DropDownListObjectToBePopulated.Items.Add(LI);&lt;br /&gt;}&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;6.&lt;/strong&gt; Finally loop thru the rows in the DataTable and create an instance of ListItem class. Populate the Text and Value properties to StateName and StateCode respectively. Finally add the ListItem object to the dropdownlist.&lt;br /&gt;&lt;strong&gt;foreach (DataRow DR in DS.Tables["State"].Rows)&lt;br /&gt;{&lt;br /&gt;ListItem LI = new ListItem();&lt;br /&gt;LI.Text = DR["StateName"].ToString();&lt;br /&gt;LI.Value = DR["StateCode"].ToString();&lt;br /&gt;DropDownListObjectToBePopulated.Items.Add(LI);&lt;br /&gt;}&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;7.&lt;/strong&gt; Drag and drop the dropdownlist on a webform. Call the PopulateDropdownlist() custom function in the Page_Load event handler. When you call the custom function pass the dropdownlist to be populated, XML file path and the initial string.&lt;br /&gt;&lt;strong&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;PopulateDropdownlist(DropDownList1, "DropDownListSource.xml", "Select State");&lt;br /&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-3708452382160905652?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/3708452382160905652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2008/11/how-to-bind-xml-file-to-dropdownlist.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/3708452382160905652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/3708452382160905652'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2008/11/how-to-bind-xml-file-to-dropdownlist.html' title='write a custom reusable function to populate a dropdownlist'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-2393089302518421167</id><published>2008-11-19T15:25:00.000-08:00</published><updated>2011-12-01T13:50:21.791-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DataSet.Clone'/><category scheme='http://www.blogger.com/atom/ns#' term='DataSet.CaseSensitive'/><category scheme='http://www.blogger.com/atom/ns#' term='DataSet.HasChanges'/><category scheme='http://www.blogger.com/atom/ns#' term='DataSet.RejectChanges'/><category scheme='http://www.blogger.com/atom/ns#' term='DataSet.Copy'/><category scheme='http://www.blogger.com/atom/ns#' term='DataSet'/><category scheme='http://www.blogger.com/atom/ns#' term='AcceptChanges'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET Interview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='constarints and relations on tables inside a DataSet'/><title type='text'>ASP.NET Interview Questions on DataSet</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;&lt;strong&gt;What is a DataSet?&lt;/strong&gt;&lt;br /&gt;DataSet is an in-memory cache of data.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;In which namespace is the DataSet class present? &lt;/strong&gt;&lt;br /&gt;System.Data&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Can you add more than one table to a dataset?&lt;/strong&gt;&lt;br /&gt;Yes&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Can you enforce constarints and relations on tables inside a DataSet?&lt;/strong&gt;&lt;br /&gt;Yes, the DataSet consists of a collection of DataTable objects that you can relate to each other with DataRelation objects. You can also enforce data integrity in the DataSet by using the UniqueConstraint and ForeignKeyConstraint objects.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What happens when you invoke AcceptChanges() method on a DataSet? &lt;/strong&gt;&lt;br /&gt;Invoking AcceptChanges() method on the DataSet causes AcceptChanges() method to be called on each table within the DataSet.&lt;br /&gt;&lt;br /&gt;Both the DataRow and DataTable classes also have AcceptChanges() methods. Calling AcceptChanges() at the DataTable level causes the AcceptChanges method for each DataRow to be called.&lt;br /&gt;&lt;br /&gt;When you call AcceptChanges on the DataSet, any DataRow objects still in edit-mode end their edits successfully. The RowState property of each DataRow also changes. Added and Modified rows become Unchanged, and Deleted rows are removed.&lt;br /&gt;&lt;br /&gt;If the DataSet contains ForeignKeyConstraint objects, invoking the AcceptChanges method also causes the AcceptRejectRule to be enforced.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Is there a way to clear all the rows from all the tables in a DataSet at once?&lt;/strong&gt;&lt;br /&gt;Yes, use the DataSet.Clear() method to clear all the rows from all the tables in a DataSet at once.&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;strong&gt;What is the difference between DataSet.Copy() and DataSet.Clone()? &lt;/strong&gt;&lt;br /&gt;DataSet.Clone() copies the structure of the DataSet, including all DataTable schemas, relations, and constraints. Does not copy any data.&lt;br /&gt;&lt;br /&gt;DataSet.Copy() copies both the structure and data.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How do you get a copy of the DataSet containing all changes made to it since it was last loaded? &lt;/strong&gt;&lt;br /&gt;Use DataSet.GetChanges() method&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the use of DataSet.HasChanges() Method? &lt;/strong&gt;&lt;br /&gt;DataSet.HasChanges method returns a boolean true if there are any changes made to the DataSet, including new, deleted, or modified rows. This method can be used to update a DataSource only if there are any changes.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How do you roll back all the changes made to a DataSet since it was created? &lt;/strong&gt;&lt;br /&gt;Invoke the DataSet.RejectChanges() method to undo or roll back all the changes made to a DataSet since it was created.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What happnes when you invoke RejectChanges method, on a DataSet that contains 3 tables in it? &lt;/strong&gt;&lt;br /&gt;RejectChanges() method will be automatically invoked on all the 3 tables in the dataset and any changes that were done will be rolled back for all the 3 tables.&lt;br /&gt;&lt;br /&gt;When the DataTable.RejectChanges method is called, any rows that are still in edit-mode cancel their edits. New rows are removed. Modified and deleted rows return back to their original state. The DataRowState for all the modified and deleted rows will be flipped back to unchanged.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the DataSet.CaseSensitive property used for? &lt;/strong&gt;&lt;br /&gt;When you set the CaseSensitive property of a DataSet to true, string comparisons for all the DataTables within dataset will be case sensitive. By default the CaseSensitive property is false. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-2393089302518421167?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/2393089302518421167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2008/11/aspnet-interview-questions-on-dataset.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/2393089302518421167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/2393089302518421167'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2008/11/aspnet-interview-questions-on-dataset.html' title='ASP.NET Interview Questions on DataSet'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-2601341469358706099</id><published>2008-11-17T16:41:00.000-08:00</published><updated>2011-12-01T13:51:02.703-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Run-time adjustment'/><category scheme='http://www.blogger.com/atom/ns#' term='What is Globalization'/><category scheme='http://www.blogger.com/atom/ns#' term='different ways to globalize web applications'/><category scheme='http://www.blogger.com/atom/ns#' term='globalizing web applications'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET Interview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='neutral cultures'/><category scheme='http://www.blogger.com/atom/ns#' term='Detect and redirect'/><title type='text'>ASP.NET Interview Questions on Globalization</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;What is Globalization?&lt;/strong&gt;&lt;br /&gt;Globalization is the process of creating an application that meets the needs of users from multiple cultures. This process involves translating the user interface elements of an application into multiple languages, using the correct currency, date and time format, calendar, writing direction, sorting rules, and other issues. Accommodating these cultural differences in an application is called localization.&lt;br /&gt;&lt;br /&gt;The Microsoft .NET Framework simplifies localization tasks substantially by making its formatting, date/time, sorting, and other classes culturally aware. Using classes from the System.Globalization namespace, you can set the application’s current culture, and much of the work is done automatically!&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are the 3 different ways to globalize web applications?&lt;br /&gt;&lt;br /&gt;Detect and redirect approach :&lt;/strong&gt; In this approach we create a separate Web application for each supported culture, and then detect the user’s culture and redirect the request to the appropriate application. This approach is best for applications with lots of text content that requires translation and few executable components.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Run-time adjustment approach : &lt;/strong&gt;In this approach we create a single Web application that detects the user’s culture and adjusts output at run time using format specifiers and other tools. This approach is best for simple applications that present limited amounts of content.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Satellite assemblies approach :&lt;/strong&gt; In this approach we create a single Web application that stores culture-dependent strings in resource files that are compiled into satellite assemblies. At run time, detect the user’s culture and load strings from the appropriate assembly. This approach is best for applications that generate content at run time or that have large executable components.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;In ASP.NET, how do you detect the user's language preference on his/her computer? &lt;/strong&gt;&lt;br /&gt;Use the Request object’s UserLanguages property to return a list of the user’s language preferences. The first element of the array returned by UserLanguages is the user’s current language on his/her computer.&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;strong&gt;What are the steps to follow to get user's culture at run time?&lt;/strong&gt;&lt;br /&gt;To get the user’s culture at run time, follow these steps:&lt;br /&gt;&lt;strong&gt;1.&lt;/strong&gt; Get the Request object’s UserLanguages property.&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; Use the returned value with the CultureInfo class to create an object representing the user’s current culture.&lt;br /&gt;&lt;br /&gt;For example, the following code gets the user’s culture and displays the English name and the abbreviated name of the culture in a label the first time the page is displayed:&lt;br /&gt;private void Page_Load(object sender, System.EventArgs e)&lt;br /&gt;{&lt;br /&gt;// Run the first time the page is displayed&lt;br /&gt;if (!IsPostBack)&lt;br /&gt;{&lt;br /&gt;// Get the user's preferred language.&lt;br /&gt;string sLang = Request.UserLanguages[0];&lt;br /&gt;// Create a CultureInfo object from it.&lt;br /&gt;CultureInfo CurrentCulture = new CultureInfo(sLang);&lt;br /&gt;lblCulture.Text = CurrentCulture.EnglishName + ": " +&lt;br /&gt;CurrentCulture.Name;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are the advantages of using detect and redirect approach to globalizing web applications? &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;1.&lt;/strong&gt; Content is maintained separately, so this approach allows the different applications to present very different information, if needed.&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; Users can be automatically directed to sites that are likely to be geographically close, and so can better meet their needs.&lt;br /&gt;&lt;strong&gt;3.&lt;/strong&gt; Content files (Web forms and HTML pages, for example) can be authored in the appropriate natural language without the complexity of including resource strings.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are the disadvantages of using detect and redirect approach to globalizing web applications? &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;1.&lt;/strong&gt; Using this approach requires that the executable portion of the Web application be compiled and deployed separately to each culture-specific Web site.&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; This approach requires more effort to maintain consistency and to debug problems across Web sites.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the use of culture attribute of the globalization element in web.config?&lt;/strong&gt;&lt;br /&gt;The Web.config file’s globalization element is used to create a culture-specific Web application. The culture attribute of the globalization element specifies how the Web application deals with various culture-dependent issues, such as dates, currency, and number formatting.&lt;br /&gt;&lt;br /&gt;Web.config globalization settings in subordinate folders override the globalization settings in the application’s root Web.config file. You can store content for various cultures in subfolders within your application, add Web.config files with the globalization settings for each culture, then direct users to the appropriate folder based on the user’s CurrentCulture.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The text on the webform is usually written from left to right. How do you change the writing direction to "right to left"? &lt;/strong&gt;&lt;br /&gt;The wrting direction of a webform can be changed using the HTML dir attribute as shown below.&lt;br /&gt;&lt;strong&gt;&amp;lt;body dir="rtl"&amp;gt; &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;You can use the dir attribute individually in panels, text boxes, or other controls as well. Setting the dir attribute on the body element applies right-to-left formatting to the entire page.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What do you mean by neutral cultures?&lt;/strong&gt;&lt;br /&gt;Neutral cultures represent general languages, such as English or Spanish, rather than a specific language and region. When you set the culture attribute for a Web application in Web.config, ASP.NET assigns that culture to all the threads running for that Web application. Threads are the basic unit to which the server allocates processor time. ASP.NET maintains multiple threads for a Web application within the aspnet_wp.exe worker process.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are advantages of setting the culture dynamically at the thread level over creating separate Web applications for each culture? &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;1.&lt;/strong&gt; All cultures share the same application code, so the application doesn’t have to be compiled and deployed for each culture.&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; The application resides at a single Web address, you don’t need to redirect users to other Web applications.&lt;br /&gt;&lt;strong&gt;3.&lt;/strong&gt; The user can choose from a full array of available cultures.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;For what type of web applications setting the culture dynamically is best suited?&lt;/strong&gt;&lt;br /&gt;Setting the culture dynamically is best suited for simple Web applications that don’t contain large amounts of text that must be translated into different languages.&lt;br /&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-2601341469358706099?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/2601341469358706099/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2008/11/aspnet-interview-questions-on.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/2601341469358706099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/2601341469358706099'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2008/11/aspnet-interview-questions-on.html' title='ASP.NET Interview Questions on Globalization'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-8403175727937283724</id><published>2008-11-13T20:09:00.000-08:00</published><updated>2011-12-01T13:51:48.391-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reverse'/><category scheme='http://www.blogger.com/atom/ns#' term='base class'/><category scheme='http://www.blogger.com/atom/ns#' term='arrays in C# value types or reference types'/><category scheme='http://www.blogger.com/atom/ns#' term='sort an array'/><category scheme='http://www.blogger.com/atom/ns#' term='total number of elements in an array'/><category scheme='http://www.blogger.com/atom/ns#' term='CopyTo()'/><category scheme='http://www.blogger.com/atom/ns#' term='3 different types of arrays'/><category scheme='http://www.blogger.com/atom/ns#' term='copy one array into another array'/><category scheme='http://www.blogger.com/atom/ns#' term='Length'/><title type='text'>C# Interview Questions - Arrays</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:verdana;"&gt;&lt;strong&gt;What is the difference between arrays in C# and arrays in other programming languages?&lt;/strong&gt;&lt;br /&gt;Arrays in C# work similarly to how arrays work in most other popular languages There are, however, a few differences as listed below&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. &lt;/strong&gt;When declaring an array in C#, the square brackets ([]) must come after the type, not the identifier. Placing the brackets after the identifier is not legal syntax in C#.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;"&gt;&lt;strong&gt;int[] IntegerArray; // not int IntegerArray[];&lt;br /&gt;&lt;br /&gt;2.&lt;/strong&gt; Another difference is that the size of the array is not part of its type as it is in the C language. This allows you to declare an array and assign any array of int objects to it, regardless of the array's length.&lt;br /&gt;&lt;br /&gt;int[] IntegerArray; // declare IntegerArray as an int array of any size&lt;br /&gt;IntegerArray = new int[10];  // IntegerArray is a 10 element array&lt;br /&gt;IntegerArray = new int[50];  // now IntegerArray is a 50 element array&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are the 3 different types of arrays that we have in C#?&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;strong&gt;1.&lt;/strong&gt; Single Dimensional Arrays&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; Multi Dimensional Arrays also called as rectangular arrays&lt;br /&gt;&lt;strong&gt;3.&lt;/strong&gt; Array Of Arrays also called as jagged arrays&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Are arrays in C# value types or reference types?&lt;br /&gt;&lt;/strong&gt;Reference types.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the base class for all arrays in C#?&lt;br /&gt;&lt;/strong&gt;System.Array&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;strong&gt;How do you sort an array in C#?&lt;br /&gt;&lt;/strong&gt;The Sort static method of the Array class can be used to sort array items.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Give an example to print the numbers in the array in descending order?&lt;br /&gt;&lt;/strong&gt;using System;&lt;br /&gt;namespace ConsoleApplication&lt;br /&gt;{&lt;br /&gt;class Program&lt;br /&gt;{&lt;br /&gt;static void Main()&lt;br /&gt;{&lt;br /&gt;int[] Numbers = { 2, 5, 3, 1, 4 };&lt;br /&gt;//Print the numbers in the array without sorting&lt;br /&gt;Console.WriteLine("Printing the numbers in the array without sorting");&lt;br /&gt;foreach (int i in Numbers)&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(i);&lt;br /&gt;}&lt;br /&gt;//Sort and then print the numbers in the array&lt;br /&gt;Console.WriteLine("Printing the numbers in the array after sorting");&lt;br /&gt;Array.Sort(Numbers);&lt;br /&gt;foreach (int i in Numbers)&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(i);&lt;br /&gt;}&lt;br /&gt;//Print the numbers in the array in desceding order&lt;br /&gt;Console.WriteLine("Printing the numbers in the array in desceding order");&lt;br /&gt;Array.Reverse(Numbers);&lt;br /&gt;foreach (int i in Numbers)&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(i);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What property of an array object can be used to get the total number of elements in an array?&lt;/strong&gt;&lt;br /&gt;Length property of array object gives you the total number of elements in an array. An example is shown below.&lt;br /&gt;using System;&lt;br /&gt;namespace ConsoleApplication&lt;br /&gt;{&lt;br /&gt;class Program&lt;br /&gt;{&lt;br /&gt;static void Main()&lt;br /&gt;{&lt;br /&gt;int[] Numbers = { 2, 5, 3, 1, 4 };&lt;br /&gt;Console.WriteLine("Total number of elements = " +Numbers.Length);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Give an example to show how to copy one array into another array?&lt;br /&gt;&lt;/strong&gt;We can use CopyTo() method to copy one array into another array. An example is shown below.&lt;br /&gt;using System;&lt;br /&gt;namespace ConsoleApplication&lt;br /&gt;{&lt;br /&gt;class Program&lt;br /&gt;{&lt;br /&gt;static void Main()&lt;br /&gt;{&lt;br /&gt;int[] Numbers = { 2, 5, 3, 1, 4 };&lt;br /&gt;int[] CopyOfNumbers=new int[5];&lt;br /&gt;Numbers.CopyTo(CopyOfNumbers,0);&lt;br /&gt;foreach (int i in CopyOfNumbers)&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(i);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-8403175727937283724?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/8403175727937283724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2008/11/c-interview-questions-arrays.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/8403175727937283724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/8403175727937283724'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2008/11/c-interview-questions-arrays.html' title='C# Interview Questions - Arrays'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-3985778938401402146</id><published>2008-11-12T17:39:00.000-08:00</published><updated>2011-12-01T13:52:36.145-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DTD'/><category scheme='http://www.blogger.com/atom/ns#' term='difference between an XML schema and a DTD'/><category scheme='http://www.blogger.com/atom/ns#' term='XML Schema'/><category scheme='http://www.blogger.com/atom/ns#' term='well-formed XML documents'/><category scheme='http://www.blogger.com/atom/ns#' term='combine both Schema and DTD'/><category scheme='http://www.blogger.com/atom/ns#' term='2 types of XML parsers'/><category scheme='http://www.blogger.com/atom/ns#' term='Document Type Definition'/><title type='text'>XML Interview Questions - Validating XML documents</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;strong&gt;What determines the validity of an XML document? &lt;/strong&gt;&lt;br /&gt;Document Type Definition(DTD) or an XML Schema determines the validity of an XML document.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is a valid XML document?&lt;br /&gt;&lt;/strong&gt;XML documents are compared to rules that are specified in a DTD or schema. A well-formed XML document that meets all of the requirements of one or more specifications is called a valid XML Document.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are the 2 types of XML parsers? &lt;/strong&gt;&lt;br /&gt;Nonvalidating Parsers - Parsers that don’t support validation&lt;br /&gt;Validating Parsers - Parsers that support validation&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Can you combine both Schema and DTD references in a single XML document?&lt;br /&gt;&lt;/strong&gt;Yes&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Are DTD's well-formed XML documents? &lt;/strong&gt;&lt;br /&gt;No, DTDs are not well-formed XML documents. This is because they follow DTD syntax rules rather than XML document syntax.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Are XML schema's well-formed XML documents?&lt;br /&gt;&lt;/strong&gt;Yes.&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;strong&gt;What is the difference between an XML schema and a DTD? &lt;/strong&gt;&lt;br /&gt;The XML Schema is the officially sanctioned Schema definition. Unlike DTDs, the format of XML Schemas follows the rules of well-formed XML documents. The Schema also allows for much more granular control over the data that is being described. Because of the XML format and the detailed format controls, Schemas tend to be very complex and often much longer than the XML documents that they are describing. Schemas are often much more easy for developers to read and follow,due to the less cryptic nature of the references in Schemas versus DTDs.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How do you define references to schemas in an XML document?&lt;br /&gt;&lt;/strong&gt;References to schemas are defined by creating an instance of the XMLSchemainstance namespace. An example is shown below.&lt;br /&gt;&lt;strong&gt;&amp;lt;rootelement xmlns:xsi=”http://www.w3.org/2001/XMLSchemainstance” xsi:noNamespaceSchemaLocation=”schemafile.xsd”&amp;gt; &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The namespace declaration reference to http://www.w3.org/2001/XMLSchemainstance resolves to an actual document at that location, which is a brief description of the way that the W3C Schema should be referenced. The noNamespaceSchemaLocation value tells us that there is no predefined namespace for the Schema. This means that all of the elements in the XML document should be validated against the schema specified. The location of the Schema is schemafile.xsd. Because there is no path defined, the file containing the schema should be located in the same directory as the XML file to be validated by the Schema.&lt;br /&gt;&lt;br /&gt;You can also define the schema location, and map it to a specific namespace by using the schemaLocation attribute declaration instead of noNamespace SchemaLocation. If you do so, you have to declare a namespace that matches the schemaLocation attribute value. The declaration must be made before you reference the schema in a schemaLocation attribute assignment.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5199087724247829980-3985778938401402146?l=venkataspinterview.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://venkataspinterview.blogspot.com/feeds/3985778938401402146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://venkataspinterview.blogspot.com/2008/11/xml-interview-questions-validating-xml.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/3985778938401402146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5199087724247829980/posts/default/3985778938401402146'/><link rel='alternate' type='text/html' href='http://venkataspinterview.blogspot.com/2008/11/xml-interview-questions-validating-xml.html' title='XML Interview Questions - Validating XML documents'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/11295753737388828672</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5199087724247829980.post-1256247483021680592</id><published>2008-11-11T18:37:00.000-08:00</published><updated>2011-12-01T13:53:10.493-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XML document declaration'/><category scheme='http://www.blogger.com/atom/ns#' term='UTF'/><category scheme='http://www.blogger.com/atom/ns#' term='When to use namespaces'/><category scheme='http://www.blogger.com/atom/ns#' term='What are XML namespaces'/><category scheme='http://www.blogger.com/atom/ns#' term='empty XML element'/><category scheme='http://www.blogger.com/atom/ns#' term='Interview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><category scheme='http://www.blogger.com/atom/ns#' term='related'/><category scheme='http://www.blogger.com/atom/ns#' term='XML attributes'/><category scheme='http://www.blogger.com/atom/ns#' term='well formed XML documents'/><category scheme='http://www.blogger.com/atom/ns#' term='based'/><title type='text'>XML related Interview Questions</title><content type='html'>&lt;table style="border: 1px solid black;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://venkataspinterview.blogspot.com/2011/05/aspnet-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatcsharpinterview.blogspot.com/2011/05/c-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;CSharp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://venkatsqlinterview.blogspot.com/2011/05/sql-server-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;SQL Server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td style="line-height: 15px; padding-top: 5px; width: 180px;"&gt;&lt;br /&gt;&lt;span style="color: black; font-family: Arial; line-height: 160%; text-decoration: underline;"&gt;All Questions&lt;/span&gt;&lt;br /&gt;&lt;a href="http://wcfinterviewquestions.blogspot.com/2011/05/wcf-interview-questions-by-topic.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 180%; padding-left: 0px; text-decoration: underline;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://mvcquestions.blogspot.com/2011/11/mvc-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;MVC&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://hrinterviewquestions.blogspot.com/2011/05/hr-interview-questions.html"&gt;&lt;span style="color: #0066cc; font-family: Arial; font-size: 11pt; line-height: 160%; padding-left: 1px; text-decoration: underline;"&gt;HR Round&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0066cc; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: 11px; line-height: 15px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;script type="text/javascript"&gt;&lt;!--            google_ad_client = "pub-5905727831268054";            /* 5LinksLinkUnit */            google_ad_slot = "3463876315";            google_ad_width = 160;            google_ad_height = 90;//--&gt;&lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="height: 60px;"&gt;&lt;td colspan="3" style="border-top: 1px solid black; color: black; font-family: Arial; font-size: 13pt; font-weight: bold; text-align: center;"&gt;Search This Site &lt;form action="http://venkataspinterview.blogspot.com/2011/06/search-results.html" id="cse-search-box"&gt;&lt;div&gt;&lt;input name="cx" type="hidden" value="partner-pub-5905727831268054:nx4lrbyuk8j" /&gt;&lt;input name="cof" type="hidden" value="FORID:11" /&gt;&lt;input name="ie" type="hidden" value="ISO-8859-1" /&gt;&lt;input name="q" size="40" type="text" /&gt;&lt;input name="sa" type="submit" value="Search" /&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="http://www.google.com/cse/brand?form=cse-search-box&amp;amp;lang=en" type="text/javascript"&gt;&lt;/script&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;strong&gt;What Is XML? &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;XML &lt;/strong&gt;stands for Extensible Markup Language, and it is used to describe documents and data in a standardized, text-based format that can be easily transported via standard Internet protocols. XML, like HTML, is based on, Standard Generalized Markup Language (SGML).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are Well-formed XML documents?&lt;br /&gt;XML&lt;/strong&gt;, is very strict about a small core of format requirements that make the difference between a text document containing a bunch of tags and an actual XML document. XML documents that meet W3C XML document formatting recommendations are described as being well-formed XML documents. Well-formed XML documents can contain elements, attributes, and text.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is an empty XML element? &lt;/strong&gt;&lt;br /&gt;Elements with no attributes or text are called as empty XML element. Empty XML elements can be represented in an XML document as shown below:&lt;br /&gt;&lt;strong&gt;&amp;lt;element/&amp;gt; &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is meant by XML document declaration?&lt;br /&gt;&lt;/strong&gt;Most XML documents start with an &amp;lt;?xml?&amp;gt; element at the top of the page. This is called an XML document declaration. An XML document declaration is an optional element that is useful to determine the version of XML and the encoding type of the source data. It is not a required element for an XML document to be well formed. Most common XML document declaration is shown below:&lt;br /&gt;&amp;lt;?xml version=”1.0” encoding=”UTF-8”?&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What does UTF stands for? &lt;/strong&gt;&lt;br /&gt;UTF stands for Universal Character Set Transformation Format.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Should every XML document have a root element?&lt;br /&gt;&lt;/strong&gt;Yes.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Can an XML document contain multiple root level elements? &lt;/strong&gt;&lt;br /&gt;No, an XML document can contain only one root level element.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the use of XML attributes?&lt;br /&gt;&lt;/strong&gt;XML attributes are used for adding more information and descriptions to the values of elements,and the text associated with elements.&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "pub-5905727831268054";/* 336x280, created 5/3/11 */google_ad_slot = "6179544304";google_ad_width = 336;google_ad_height = 280;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;strong&gt;Is XML case sensitive? &lt;/strong&gt;&lt;br /&gt;Yes&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How do you comment lines in XML?&lt;br /&gt;&lt;/strong&gt;You can comment lines in XML as shown below.&lt;br /&gt;&amp;lt;! -- This is commented line in an XML document --&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are XML namespaces? &lt;/strong&gt;&lt;br /&gt;Namespaces are a method for separating and identifying duplicate XML element names in an XML document. Namespaces can also be used as identifiers to describe data types and other information. Namespace declarations can be compared to defining a short variable name for a long variable (such as pi=3.14159....) in programming languages. In XML, the variable assignment is defined by an attribute declaration. The variable name is the attribute name, and the variable value is the attribute value. In order to identify namespace declarations versus other types of attribute declarations, a reserved xmlns: prefix is used when declaring a namespace name and value. The attribute name after the xmlns: prefix identifies the name for the defined namespace. The value of the attribute provides the unique identifier for the namespace. Once the namespace is declared, the namespace name can be used as a prefix in element names.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Why is it a good idea to use a URL as the XML namespace value? &lt;/strong&gt;&lt;br /&gt;Although the namespace declaration value does not need to be a URL or resolve to an actual URL destination, it is a good idea to use a URL anyway, and to choose a URL that could resolve to an actual destination, just in case developers want to add documentation for the namespace to the URL in the future.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;When to use namespaces?&lt;br /&gt;&lt;/strong&gt;Namespaces are optional components of basic XML documents. However, namespace declarations are recommended if your XML documents have any current or future potential of being shared with other XML documents that may share the same element names. Also, newer 
