<?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:blogger='http://schemas.google.com/blogger/2008' 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-5771365145222184138</id><updated>2024-08-31T23:17:10.376-07:00</updated><category term="Asp.net Tips"/><category term="Sql Tips"/><category term="ajax tips"/><category term="Combining All Column into One Column Sql"/><category term="coalesce function Sql"/><title type='text'>Asp.net and C#.net Tips</title><subtitle type='html'>Share What You know.......!!!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://aspdotnetmania.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://aspdotnetmania.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10409168669089194645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5771365145222184138.post-5402933704167868538</id><published>2013-10-14T22:29:00.000-07:00</published><updated>2013-10-14T22:29:48.150-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net Tips"/><title type='text'>Tips to Improve ASP dotnet Application Performance</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div id=&quot;fb-root&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://connect.facebook.net/en_US/all.js#appId=121154747981512&amp;amp;xfbml=1&quot;&gt;
&lt;/script&gt;&lt;fb:like font=&quot;lucida grande&quot; href=&quot;http://www.facebook.com/pages/AspNet-With-C/150227715035982&quot; send=&quot;true&quot; show_faces=&quot;true&quot; width=&quot;450&quot;&gt;&lt;/fb:like&gt;

&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
There are certain things you should take into account when you are developing your applications.&lt;br /&gt;
&lt;br /&gt;
I have learned to avoid and do certain things that increase your application performance by a massive amount!&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1)Avoid Server-Side Validation&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Try to avoid server-side validation, use client-side instead. Server-Side will just consume valuable resources on your servers, and cause more chat back and forth.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;2)Repeater Contro&lt;/b&gt;l Good as Compare to &amp;nbsp;DataList, DataGrid, and DataView controls.&lt;br /&gt;
&lt;br /&gt;
Asp.net is a great platform, unfortunately a lot of the controls that were developed are heavy in html, and create not the greatest scaleable html from a performance standpoint. ASP.net &amp;nbsp;repeater control is awesome! &amp;nbsp;Use it! &amp;nbsp;You might write &amp;nbsp;more code, but you will thank me in the long run!&lt;br /&gt;
&lt;br /&gt;
3)Always check&lt;b&gt; Page.IsValid&lt;/b&gt; when using Validator Controls&lt;br /&gt;
&lt;br /&gt;
So you’ve dropped on some validator controls, and you think your good to go because ASP.net does everything for you! &amp;nbsp;Right? &amp;nbsp;Wrong! &amp;nbsp;All that happens if bad data is received is the IsValid flag is set to false. So make sure you check Page.IsValid before processing your forms!&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;4)Page.IsPostBack&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Make sure you don’t execute code needlessly. I don’t know how many web developers forget about checking IsPostBack! &amp;nbsp;It seems like such a basic thing to me! &amp;nbsp;Needless processing!&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;5)Avoid Exceptions&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Avoid throwing exceptions, and handling useless exceptions. Exceptions are probably one of the heaviest resource hogs and causes of slowdowns you will ever see in web applications, as well as windows applications. &amp;nbsp;Write your code so they don’t happen! &amp;nbsp;Don’t code by exception!&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;6)Turn Off ViewState&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
If you are not using form postback, turn off viewsate, by default, controls will turn on viewsate and slow your site.Example :-if You Have Used Lable to display name static.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;asp:label id=&quot;lblName&quot; nbsp=&quot;&quot; p=&quot;&quot; runat=&quot;server&quot; width=&quot;423px&quot;&gt;&lt;br /&gt;
&amp;nbsp;ForeColor=&quot;Red&quot; EnableViewState=&quot;false&quot;&amp;gt;&lt;/asp:label&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;7)Use the Finally Method&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
If you have opened any connections to the database, or files, etc, make sure that you close them at the end! &amp;nbsp;The Finally block is really the best place to do so, as it is the only block of code that will surely execute.&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div id=&quot;fb-root&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://connect.facebook.net/en_US/all.js#appId=121154747981512&amp;amp;xfbml=1&quot;&gt;
&lt;/script&gt;&lt;fb:like font=&quot;lucida grande&quot; href=&quot;http://www.facebook.com/pages/AspNet-With-C/150227715035982&quot; send=&quot;true&quot; show_faces=&quot;true&quot; width=&quot;450&quot;&gt;&lt;/fb:like&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aspdotnetmania.blogspot.com/feeds/5402933704167868538/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://aspdotnetmania.blogspot.com/2013/10/tips-to-improve-asp-dotnet-application.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/5402933704167868538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/5402933704167868538'/><link rel='alternate' type='text/html' href='http://aspdotnetmania.blogspot.com/2013/10/tips-to-improve-asp-dotnet-application.html' title='Tips to Improve ASP dotnet Application Performance'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10409168669089194645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5771365145222184138.post-4965103676165751713</id><published>2011-10-11T05:05:00.000-07:00</published><updated>2011-10-13T22:26:08.986-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="coalesce function Sql"/><category scheme="http://www.blogger.com/atom/ns#" term="Combining All Column into One Column Sql"/><category scheme="http://www.blogger.com/atom/ns#" term="Sql Tips"/><title type='text'>COALESCE Function In Sql Server</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div id=&quot;fb-root&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://connect.facebook.net/en_US/all.js#appId=121154747981512&amp;amp;xfbml=1&quot;&gt;
&lt;/script&gt;&lt;fb:like font=&quot;lucida grande&quot; href=&quot;http://www.facebook.com/pages/AspNet-With-C/150227715035982&quot; send=&quot;true&quot; show_faces=&quot;true&quot; width=&quot;450&quot;&gt;&lt;/fb:like&gt;

&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
During Development we have use more time Colesce method If someone have home address or office address suppose if you dispaly available first record means you can use coalesce method or concatinate columns we use this coding&lt;br /&gt;
&lt;br /&gt;
I have Below Table :&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQAdoghlIiAbZvRbsEVAX3Pom6xccSDn26qTloshfaoE6g3cZjys1WS0tE752CNbRO6ybD_s52ifd8E7tAwqzyzcX44eMxYGMCR9Ut44ZMdJF-iEpMou685JiTPetf1_pxfCUL4mBqiCKz/s1600/CreateTable.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;178&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQAdoghlIiAbZvRbsEVAX3Pom6xccSDn26qTloshfaoE6g3cZjys1WS0tE752CNbRO6ybD_s52ifd8E7tAwqzyzcX44eMxYGMCR9Ut44ZMdJF-iEpMou685JiTPetf1_pxfCUL4mBqiCKz/s400/CreateTable.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Insert Some Data in it :&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4w7Scj8jAtoVcFFLwvfSEDWLtVQjs8s3XsWd-vc2wwUAmH_n_C1_ppEEZRoQOM2JujN4pDntruud-vur6BhhMd163P4yEkfFaaV7tAebG2W6SnPRyf3jhohltz9dmEebKCOa1uDG0xZzg/s1600/TableData.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;176&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4w7Scj8jAtoVcFFLwvfSEDWLtVQjs8s3XsWd-vc2wwUAmH_n_C1_ppEEZRoQOM2JujN4pDntruud-vur6BhhMd163P4yEkfFaaV7tAebG2W6SnPRyf3jhohltz9dmEebKCOa1uDG0xZzg/s640/TableData.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Now the basic use of&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #a64d79; font-weight: bold;&quot;&gt;Colesce:&lt;/span&gt;&lt;br /&gt;
You can see the Id 2 hasnot OfficePhoneNo and id 5 has only MobileNo.&lt;br /&gt;
Colesce function can display available first record from one of the column.&lt;br /&gt;
&lt;br /&gt;
It&#39;s Query Like :&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;,Courier,monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;select&lt;/span&gt; name ,&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: magenta;&quot;&gt;coalesce&lt;/span&gt;(OfficePhoneNo,HomePhoneNo,MobileNo)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;,Courier,monospace;&quot;&gt;PhoneNo &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;from &lt;/span&gt;EmpDetails&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
and Result will be :&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9BbcAP11F4Ckj0y1DQcCd4Kr6oVAPhK17oJObPH5QB5Qa_FfnZgCKcqvLGK8CBva5yzx5YED5rtcMSenN1_JL3UQVGpain7n-yZmts9e5CE2sv59XBsukGkVZ4Zlv3gQwHSAao6W8jWSq/s1600/queryResult.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;239&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9BbcAP11F4Ckj0y1DQcCd4Kr6oVAPhK17oJObPH5QB5Qa_FfnZgCKcqvLGK8CBva5yzx5YED5rtcMSenN1_JL3UQVGpain7n-yZmts9e5CE2sv59XBsukGkVZ4Zlv3gQwHSAao6W8jWSq/s320/queryResult.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Now I can show you another example of it.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
We can also use coalesce function for&amp;nbsp;Combining&amp;nbsp;all column into single column.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: Consolas, &quot;Courier New&quot;, Courier, Monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}

.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;TABLE&lt;/span&gt; Emp(FName &lt;span class=&quot;kwrd&quot;&gt;VARCHAR&lt;/span&gt;(25))

&lt;span class=&quot;kwrd&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;INTO&lt;/span&gt; Emp &lt;span class=&quot;kwrd&quot;&gt;VALUES&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;PalPatel&#39;&lt;/span&gt;)
&lt;span class=&quot;kwrd&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;INTO&lt;/span&gt; Emp &lt;span class=&quot;kwrd&quot;&gt;VALUES&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;DishaAgola&#39;&lt;/span&gt;)
&lt;span class=&quot;kwrd&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;INTO&lt;/span&gt; Emp &lt;span class=&quot;kwrd&quot;&gt;VALUES&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;Bansi&#39;&lt;/span&gt;)
&lt;span class=&quot;kwrd&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;INTO&lt;/span&gt; Emp &lt;span class=&quot;kwrd&quot;&gt;VALUES&lt;/span&gt;(&lt;span class=&quot;str&quot;&gt;&#39;Nirav&#39;&lt;/span&gt;)


&lt;span class=&quot;kwrd&quot;&gt;DECLARE&lt;/span&gt; @nam NVARCHAR(1024)

&lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt; @nam=&lt;span class=&quot;kwrd&quot;&gt;COALESCE&lt;/span&gt;(@nam+&lt;span class=&quot;str&quot;&gt;&#39;,&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;&#39;&lt;/span&gt;)+ FName &lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; Emp

&lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt; Emp= @nam&lt;/pre&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Output :&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
PalPatel,DishaAgola,Bansi,Nirav&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Thats it .....&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;fb-root&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://connect.facebook.net/en_US/all.js#appId=121154747981512&amp;amp;xfbml=1&quot;&gt;
&lt;/script&gt;&lt;fb:like font=&quot;lucida grande&quot; href=&quot;http://www.facebook.com/pages/AspNet-With-C/150227715035982&quot; send=&quot;true&quot; show_faces=&quot;true&quot; width=&quot;450&quot;&gt;&lt;/fb:like&gt;
&lt;/div&gt;
&lt;a href=&quot;http://bloggers.com/ParthivAgola&quot; rel=&quot;dofollow&quot;&gt;&lt;img alt=&quot;Parthiv Agola - Find me on Bloggers.com&quot; src=&quot;http://bloggers.com/b/40851/p/img_01.png&quot; title=&quot;Parthiv Agola - Find me on Bloggers.com&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://aspdotnetmania.blogspot.com/feeds/4965103676165751713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://aspdotnetmania.blogspot.com/2011/10/coalesce-function-in-sql-server.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/4965103676165751713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/4965103676165751713'/><link rel='alternate' type='text/html' href='http://aspdotnetmania.blogspot.com/2011/10/coalesce-function-in-sql-server.html' title='COALESCE Function In Sql Server'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10409168669089194645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQAdoghlIiAbZvRbsEVAX3Pom6xccSDn26qTloshfaoE6g3cZjys1WS0tE752CNbRO6ybD_s52ifd8E7tAwqzyzcX44eMxYGMCR9Ut44ZMdJF-iEpMou685JiTPetf1_pxfCUL4mBqiCKz/s72-c/CreateTable.png" height="72" width="72"/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5771365145222184138.post-3740962758668233737</id><published>2011-09-16T04:55:00.000-07:00</published><updated>2011-09-16T05:17:25.730-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net Tips"/><title type='text'>Dynamically Load Webuser Control with Properties.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Create a new class to act as the base control:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #a64d79; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;b&gt;public class MyBaseControl : System.Web.UI.UserControl&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string MyProperty &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return ViewState[&quot;MyProp&quot;] as string; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { ViewState[&quot;MyProp&quot;] = value; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcUprHOm_QiGO5litaGXb2Ft7_duHpVNHXpFr_cfUZk93U4RIC_qv8gWJrj1_4RoP7fYfQoEam_NLvPxcG4l2JcT5hJwjxhyphenhyphenjlzSEsiCQq7tio8jQYuGDFGTjvvinFVuDNQDjnkms9cIwu/s1600/webusercontrol.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;149&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcUprHOm_QiGO5litaGXb2Ft7_duHpVNHXpFr_cfUZk93U4RIC_qv8gWJrj1_4RoP7fYfQoEam_NLvPxcG4l2JcT5hJwjxhyphenhyphenjlzSEsiCQq7tio8jQYuGDFGTjvvinFVuDNQDjnkms9cIwu/s320/webusercontrol.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;Then update your user controls to inherit from your base class instead of UserControl:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #a64d79; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;public partial class SampleControl2 : MyBaseControl&lt;/span&gt;&lt;br style=&quot;color: #a64d79; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;color: #a64d79; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;color: #a64d79; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;color: #a64d79; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Then, in the place where you load the controls, change this:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #a64d79; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;b&gt;UserControl uc = (UserControl)LoadControl(controlPath);&lt;br /&gt;PlaceHolder1.Controls.Add(uc);&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
To:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #a64d79; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;MyBaseControl uc = (MyBaseControl)LoadControl(controlPath);&lt;/span&gt;&lt;br style=&quot;color: #a64d79; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;color: #a64d79; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;uc.MyProperty = &quot;foo&quot;;&lt;/span&gt;&lt;br style=&quot;color: #a64d79; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;color: #a64d79; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;PlaceHolder1.Controls.Add(uc);&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Any suggestions will be appreciated greatly. !!.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aspdotnetmania.blogspot.com/feeds/3740962758668233737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://aspdotnetmania.blogspot.com/2011/09/dynamically-load-webuser-control-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/3740962758668233737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/3740962758668233737'/><link rel='alternate' type='text/html' href='http://aspdotnetmania.blogspot.com/2011/09/dynamically-load-webuser-control-with.html' title='Dynamically Load Webuser Control with Properties.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10409168669089194645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcUprHOm_QiGO5litaGXb2Ft7_duHpVNHXpFr_cfUZk93U4RIC_qv8gWJrj1_4RoP7fYfQoEam_NLvPxcG4l2JcT5hJwjxhyphenhyphenjlzSEsiCQq7tio8jQYuGDFGTjvvinFVuDNQDjnkms9cIwu/s72-c/webusercontrol.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5771365145222184138.post-6522354915741322182</id><published>2011-09-16T04:54:00.000-07:00</published><updated>2013-10-14T22:24:44.916-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net Tips"/><title type='text'>Get Data from Excel To Sql Server Using Asp.net</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div id=&quot;fb-root&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://connect.facebook.net/en_US/all.js#appId=121154747981512&amp;amp;xfbml=1&quot;&gt;
&lt;/script&gt;&lt;fb:like font=&quot;lucida grande&quot; href=&quot;http://www.facebook.com/pages/AspNet-With-C/150227715035982&quot; send=&quot;true&quot; show_faces=&quot;true&quot; width=&quot;450&quot;&gt;&lt;/fb:like&gt;

&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Here I am going to show you the step by step process to import data from Excel to SQL Server. To do so follow the below steps :
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Step:1 Create Sample Table.

&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPhpkWwU-KILKeKjCvgTM68y-fmj7W1nvAPxWOBAIZYU3mdIhfH2RX7QtQsfgUZPUpCf8aXKpvQKxhyphenhyphenRtFaShfgS34Oxe3eofWSuTmIbrdcSHBfaSJtRIhefEOiQsjdfGfdbvI0M73xgTc/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; GO  
 CREATE TABLE [dbo].[Product_Master](  
   [Product_Code] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,  
   [Product_Name] [varchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,  
   [Price] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL  
 ) ON [PRIMARY]  
 GO  
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;Step:2 Create New Web site with new webpage named as Default.aspx (Following is the code contained in the Default.aspx page).

&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPhpkWwU-KILKeKjCvgTM68y-fmj7W1nvAPxWOBAIZYU3mdIhfH2RX7QtQsfgUZPUpCf8aXKpvQKxhyphenhyphenRtFaShfgS34Oxe3eofWSuTmIbrdcSHBfaSJtRIhefEOiQsjdfGfdbvI0M73xgTc/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;1:  &amp;lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeFile=&quot;Default.aspx.cs&quot; Inherits=&quot;_Default&quot; %&amp;gt;  
2:  &amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&amp;gt;  
3:  &amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&amp;gt;  
4:  &amp;lt;head runat=&quot;server&quot;&amp;gt;  
5:    &amp;lt;title&amp;gt;Import Excel Data To SQL Server&amp;lt;/title&amp;gt;  
6:  &amp;lt;/head&amp;gt;  
7:  &amp;lt;body&amp;gt;  
8:    &amp;lt;form id=&quot;form1&quot; runat=&quot;server&quot;&amp;gt;  
9:    &amp;lt;div&amp;gt;  
10:      &amp;lt;asp:Label ID=&quot;lblHeading&quot; runat=&quot;server&quot; Text=&quot;Select File To Upload : &quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;  
11:      &amp;lt;asp:FileUpload ID=&quot;FileUpload1&quot; runat=&quot;server&quot; /&amp;gt;  
12:      &amp;lt;br /&amp;gt;  
13:      &amp;lt;br /&amp;gt;  
14:      &amp;lt;asp:Button ID=&quot;btnUpload&quot; runat=&quot;server&quot; Text=&quot;Upload&quot;   
15:        onclick=&quot;btnUpload_Click&quot; /&amp;gt;     
16:      &amp;lt;asp:Button ID=&quot;btnSaveToDB&quot; runat=&quot;server&quot; Text=&quot;Save To DB&quot;   
17:        onclick=&quot;btnSaveToDB_Click&quot; /&amp;gt;  
18:        &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;  
19:      &amp;lt;asp:Label ID=&quot;lblerror&quot; runat=&quot;server&quot; ForeColor =&quot;Red&quot; Text=&quot;&quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;  
20:    &amp;lt;/div&amp;gt;  
21:    &amp;lt;/form&amp;gt;  
22:  &amp;lt;/body&amp;gt;  
23:  &amp;lt;/html&amp;gt;  
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Step:3 Here is the C# code of the Default.aspx.cs file:

&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPhpkWwU-KILKeKjCvgTM68y-fmj7W1nvAPxWOBAIZYU3mdIhfH2RX7QtQsfgUZPUpCf8aXKpvQKxhyphenhyphenRtFaShfgS34Oxe3eofWSuTmIbrdcSHBfaSJtRIhefEOiQsjdfGfdbvI0M73xgTc/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;1:  using System;  
2:  using System.Configuration;  
3:  using System.Data;  
4:  using System.Linq;  
5:  using System.Web;  
6:  using System.Web.Security;  
7:  using System.Web.UI;  
8:  using System.Web.UI.HtmlControls;  
9:  using System.Web.UI.WebControls;  
10:  using System.Web.UI.WebControls.WebParts;  
11:  using System.Xml.Linq;  
12:  using System.IO;  
13:  public partial class _Default : System.Web.UI.Page   
14:  {  
15:    protected void Page_Load(object sender, EventArgs e)  
16:    {  
17:    }  
18:    protected void btnUpload_Click(object sender, EventArgs e)  
19:    {  
20:      if (FileUpload1.HasFile)  
21:      {  
22:        var uploadFile = new UploadFile(FileUpload1.FileName);  
23:        try  
24:        {  
25:          FileUpload1.SaveAs(uploadFile.SavePath);  
26:        }  
27:        catch (Exception ex)  
28:        {  
29:          lblerror.Text = &quot;error : &quot;+ex.Message;  
30:        }  
31:       }  
32:    }  
33:    protected void btnSaveToDB_Click(object sender, EventArgs e)  
34:    {  
35:      ImportDataIntoDB idid = new ImportDataIntoDB();  
36:      string count = idid.saveDataToDB();  
37:      if (Convert.ToInt16(count) &amp;lt; 0)  
38:      {  
39:        lblerror.Text = &quot;Error Occurred...&quot;;  
40:      }  
41:      UploadFile upFile = new UploadFile();  
42:      upFile.DeleteFileNoException();  
43:    }  
44:  }  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Step:4 In this i call the UploadFile class which is created in a separate class file. This class is used to store uploaded file and also used to generate OleDb connection string as per file selected. Here is the code of UploadFile Class :


&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPhpkWwU-KILKeKjCvgTM68y-fmj7W1nvAPxWOBAIZYU3mdIhfH2RX7QtQsfgUZPUpCf8aXKpvQKxhyphenhyphenRtFaShfgS34Oxe3eofWSuTmIbrdcSHBfaSJtRIhefEOiQsjdfGfdbvI0M73xgTc/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;1:  using System;  
2:  using System.Data;  
3:  using System.Configuration;  
4:  using System.Linq;  
5:  using System.Web;  
6:  using System.Web.Security;  
7:  using System.Web.UI;  
8:  using System.Web.UI.HtmlControls;  
9:  using System.Web.UI.WebControls;  
10:  using System.Web.UI.WebControls.WebParts;  
11:  using System.Xml.Linq;  
12:  using System.IO;  
13:  ///   
14:  /// Summary description for UploadFile  
15:  ///   
16:  public class UploadFile  
17:  {  
18:    private string savePath;  
19:    public UploadFile()  
20:    {  
21:    }  
22:    public UploadFile(string originalFileName)  
23:    {  
24:      string tempFileName = Guid.NewGuid().ToString(&quot;N&quot;) + &quot;_&quot; + originalFileName;  
25:      string saveLocation = HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings[&quot;FileUploadLocation&quot;]);  
26:      savePath = Path.Combine(saveLocation, tempFileName);  
27:      HttpContext.Current.Session[&quot;savePath&quot;] = savePath;  
28:    }  
29:    ///   
30:    /// Temp path used to save the uploaded file  
31:    ///   
32:    public string SavePath  
33:    {  
34:      get  
35:      {  
36:        return savePath;  
37:      }  
38:    }  
39:    ///   
40:    /// Attempt to delete temp file  
41:    ///   
42:    public void DeleteFileNoException()  
43:    {  
44:      savePath = HttpContext.Current.Session[&quot;savePath&quot;].ToString();  
45:      if (File.Exists(savePath))  
46:      {  
47:        try  
48:        {  
49:          File.Delete(savePath);  
50:        }  
51:        catch { }  
52:      }  
53:    }  
54:    ///   
55:    /// Return connection strinng based on file extension  
56:    ///   
57:    public string GetOleDbConnectionString()  
58:    {  
59:      savePath = HttpContext.Current.Session[&quot;savePath&quot;].ToString();  
60:      var finfo = new FileInfo(savePath);  
61:      if (!finfo.Exists)  
62:      {  
63:        throw new FileNotFoundException(savePath);  
64:      }  
65:      var fileExtension = finfo.Extension.ToLower();  
66:      switch (fileExtension)  
67:      {  
68:        case &quot;.xls&quot;:  
69:          return string.Format(ConfigurationManager.AppSettings[&quot;xlsOleDBConnection&quot;], savePath);  
70:        case &quot;.xlsx&quot;:  
71:          return string.Format(ConfigurationManager.AppSettings[&quot;xlsxOleDBConnection&quot;], savePath);  
72:        default:  
73:          throw new NotSupportedException(String.Format(&quot;This file type {0} is not supported!&quot;, fileExtension));  
74:      }  
75:    }  
76:  }  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Step:5 Now next step is read that file and save the data into sql server.
Here is the method which reads the data from excel and save it into sql server database :

&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPhpkWwU-KILKeKjCvgTM68y-fmj7W1nvAPxWOBAIZYU3mdIhfH2RX7QtQsfgUZPUpCf8aXKpvQKxhyphenhyphenRtFaShfgS34Oxe3eofWSuTmIbrdcSHBfaSJtRIhefEOiQsjdfGfdbvI0M73xgTc/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;1:  public string saveDataToDB()  
2:    {  
3:      int j = 0;  
4:      string strQuery = &quot;SELECT ProductCode,ProductName,ItemCaptionJP,ItemTextJP,IngredientsJP,CountryOfOrigin,HowToStore FROM [Sheet1$]&quot;;  
5:      DataTable dt = new DataTable();  
6:      OleDbCommand ocmd = new OleDbCommand(strQuery, oleconn);  
7:      //OleDbDataAdapter da = new OleDbDataAdapter(strQuery, oleconn);  
8:      oleconn.Open();  
9:      OleDbDataReader odr = ocmd.ExecuteReader();  
10:      int i = 0;  
11:      if (odr.HasRows)  
12:      {  
13:        while (odr.Read())  
14:        {  
15:          if (i == 0)  
16:            sb.Append(&quot;UPDATE Product_Master set [itemCaption_jp]=N&#39;&quot; + odr[&quot;ItemCaptionJP&quot;] + &quot;&#39;,[itemText_jp]=N&#39;&quot; + odr[&quot;ItemTextJP&quot;].ToString() + &quot;&#39;,[ingredients_jp]=N&#39;&quot; + odr[&quot;IngredientsJP&quot;].ToString() + &quot;&#39;,[countryoforigin_jp]=N&#39;&quot; + odr[&quot;CountryOfOrigin&quot;].ToString() + &quot;&#39;,[howtostore_jp]=N&#39;&quot; + odr[&quot;HowToStore&quot;].ToString() + &quot;&#39; where [alternate_code]=&#39;&quot; + odr[&quot;ProductCode&quot;].ToString() + &quot;&#39; and Product_Name=&#39;&quot; + odr[&quot;ProductName&quot;].ToString() + &quot;&#39;&quot;);  
17:          else  
18:            sb.Append(&quot;;UPDATE Product_Master set [itemCaption_jp]=N&#39;&quot; + odr[&quot;ItemCaptionJP&quot;] + &quot;&#39;,[itemText_jp]=N&#39;&quot; + odr[&quot;ItemTextJP&quot;].ToString() + &quot;&#39;,[ingredients_jp]=N&#39;&quot; + odr[&quot;IngredientsJP&quot;].ToString() + &quot;&#39;,[countryoforigin_jp]=N&#39;&quot; + odr[&quot;CountryOfOrigin&quot;].ToString() + &quot;&#39;,[howtostore_jp]=N&#39;&quot; + odr[&quot;HowToStore&quot;].ToString() + &quot;&#39; where [alternate_code]=&#39;&quot; + odr[&quot;ProductCode&quot;].ToString() + &quot;&#39; and Product_Name=&#39;&quot; + odr[&quot;ProductName&quot;].ToString() + &quot;&#39;&quot;);  
19:          i++;  
20:        }  
21:        j = UpdatedCommand(sb.ToString());  
22:      }  
23:      return j.ToString();  
24:    }  
25:    #region update,delete,insert data in Database  
26:    public int UpdatedCommand(string strupdatequery)  
27:    {  
28:      int intreturn = 0;  
29:      ClientScriptManager cs = Page.ClientScript;  
30:      Type ty = this.GetType();  
31:      try  
32:      {  
33:        SqlCommand cmdupdatecommand = new SqlCommand();  
34:        transsql = null;  
35:        if (sqlconn.State != ConnectionState.Closed)  
36:        {  
37:          sqlconn.Close();  
38:        }  
39:        sqlconn.Open();  
40:        transsql = sqlconn.BeginTransaction();  
41:        cmdupdatecommand.CommandTimeout = 0;  
42:        cmdupdatecommand.CommandText = strupdatequery;  
43:        cmdupdatecommand.Connection = sqlconn;  
44:        cmdupdatecommand.Transaction = transsql;  
45:        intreturn = cmdupdatecommand.ExecuteNonQuery();  
46:        transsql.Commit();  
47:        if (sqlconn.State != ConnectionState.Closed)  
48:        {  
49:          sqlconn.Close();  
50:        }  
51:        return intreturn;  
52:      }  
53:      catch (SqlException oleex)  
54:      {  
55:        transsql.Rollback();  
56:        strupdatequery = oleex.Message;  
57:        strerorrmsg1 = &quot;Error In UpdatedCommand method &quot; + oleex.Message.ToString();  
58:        strerorrmsg2 = strerorrmsg1.Replace(&quot;&#39;&quot;, &quot;&quot;);  
59:        string msg = &quot;alert(&#39;&quot; + strerorrmsg2 + &quot;&#39;);&quot;;  
60:        cs.RegisterStartupScript(ty, strerorrmsg1, msg, true);  
61:        return -3;  
62:      }  
63:      catch (System.Exception exp)  
64:      {  
65:        transsql.Rollback();  
66:        strupdatequery = exp.Message;  
67:        strerorrmsg1 = &quot;Error In UpdatedCommand method &quot; + exp.Message.ToString();  
68:        strerorrmsg2 = strerorrmsg1.Replace(&quot;&#39;&quot;, &quot;&quot;);  
69:        string msg = &quot;alert(&#39;&quot; + strerorrmsg2 + &quot;&#39;);&quot;;  
70:        cs.RegisterStartupScript(ty, strerorrmsg1, msg, true);  
71:        return -3;  
72:      }  
73:      finally  
74:      {  
75:        if (sqlconn.State != ConnectionState.Closed)  
76:        {  
77:          sqlconn.Close();  
78:        }  
79:      }  
80:    }  
81:    #endregion   
&lt;/code&gt;&lt;/pre&gt;
&lt;div id=&quot;fb-root&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://connect.facebook.net/en_US/all.js#appId=121154747981512&amp;amp;xfbml=1&quot;&gt;
&lt;/script&gt;&lt;fb:like font=&quot;lucida grande&quot; href=&quot;http://www.facebook.com/pages/AspNet-With-C/150227715035982&quot; send=&quot;true&quot; show_faces=&quot;true&quot; width=&quot;450&quot;&gt;&lt;/fb:like&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aspdotnetmania.blogspot.com/feeds/6522354915741322182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://aspdotnetmania.blogspot.com/2011/09/get-data-from-excel-to-sql-server-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/6522354915741322182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/6522354915741322182'/><link rel='alternate' type='text/html' href='http://aspdotnetmania.blogspot.com/2011/09/get-data-from-excel-to-sql-server-using.html' title='Get Data from Excel To Sql Server Using Asp.net'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10409168669089194645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5771365145222184138.post-7853866894627354194</id><published>2011-09-13T04:12:00.000-07:00</published><updated>2011-09-16T05:14:42.111-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net Tips"/><title type='text'>4 Small But Important Tips For Fresher of Asp.net.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div id=&quot;fb-root&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://connect.facebook.net/en_US/all.js#appId=121154747981512&amp;amp;xfbml=1&quot;&gt;
&lt;/script&gt;&lt;fb:like font=&quot;lucida grande&quot; href=&quot;http://www.facebook.com/pages/AspNet-With-C/150227715035982&quot; send=&quot;true&quot; show_faces=&quot;true&quot; width=&quot;450&quot;&gt;&lt;/fb:like&gt; &lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4yLT8ADVPkXpPtICECvGw1Dx12GxIQFz0LUCTAD_BXrNKjHT6sz-_PDXB2erizwGYj-2_KZRPNRQuQdoI408kzA44dlkVAiwCGZxKU2JgMGkcC7JOsJK_nvWP9ORnR3IhCez30uGIe2Q3/s1600/4tipss.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;122&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4yLT8ADVPkXpPtICECvGw1Dx12GxIQFz0LUCTAD_BXrNKjHT6sz-_PDXB2erizwGYj-2_KZRPNRQuQdoI408kzA44dlkVAiwCGZxKU2JgMGkcC7JOsJK_nvWP9ORnR3IhCez30uGIe2Q3/s320/4tipss.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Asp.net is a awesome framework developing web sites and web applications.with visual studio asp.net become cooler and cooler. I have wrote an article Visual Studio 2010 New Tips and Shortcut previously. now I thought to write for asp.net tips and tricks because as the way you are using the framework it’ll be hard or easier to understand and do some work with minimum codes.&lt;br /&gt;
Ok here we go we’ll see what are the cool features offer asp.net for .net web developers.&lt;br /&gt;
&lt;br /&gt;
1. Maintain the position of scrollbar on postback : since asp.net 1.1 it was a very hard to maintain the position of scrollbar when doing postback. it’s was very necessary feature when we edit some data and after submit find position that we were editing. In asp.net 2.0 you can simply add the MantainScrollPositionOnPostBack attribute to the page directive.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #a64d79; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;lt;%@ Page Language=&quot;C#&quot; MaintainScrollPositionOnPostback=&quot;true&quot; AutoEventWireup=&quot;true&quot; CodeFile=&quot;...&quot; Inherits=&quot;...&quot; %&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
2. Set Default Button for form when user hit the enter key : In asp.net 1.1 required to write javascript to set default key for when form submit after hit Enter key. fortunatly you can use HtmlForcontrol’s DefaultButton property to set which button should be clicked when the user hit the enter&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #a64d79; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br style=&quot;color: #a64d79; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #a64d79; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;lt;form id=&quot;frm&quot; DefaultButton=&quot;btnSubmit&quot; runat=&quot;server&quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; ...&lt;br /&gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
3. Set the default focus to control when page loads : as mention above also we can set default focus for page load like below&lt;br /&gt;
&lt;b style=&quot;color: #a64d79;&quot;&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;color: #a64d79;&quot;&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;color: #a64d79;&quot;&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;color: #a64d79;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;lt;form id=&quot;frm&quot; DefaultFocus=&quot;txtUserName&quot; runat=&quot;server&quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; ...&lt;br /&gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
4. Strongly type access to the cross-page postbacks : asp.net 2.0 introduced the concept of cross page post back where one page could post back information to another page.if you add public property in to code behind page that initiate the postback operation, you can access property in strong type manner by adding PreviouPageType directive in to target page of the post back.&lt;br /&gt;
&lt;span style=&quot;color: #741b47; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;lt;%@ PreviousPageType VirtualPath=&quot;Default.aspx&quot; %&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;color: #a64d79;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
by adding this directive to pageyou can access the TextBox defind in previous page in strongly type manner.&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;color: #a64d79; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;TextBox tb = PreviousPage.SearchTextBox; &lt;/b&gt;&lt;br /&gt;
&lt;div id=&quot;fb-root&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://connect.facebook.net/en_US/all.js#appId=121154747981512&amp;amp;xfbml=1&quot;&gt;
&lt;/script&gt;&lt;fb:like font=&quot;lucida grande&quot; href=&quot;http://www.facebook.com/pages/AspNet-With-C/150227715035982&quot; send=&quot;true&quot; show_faces=&quot;true&quot; width=&quot;450&quot;&gt;&lt;/fb:like&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aspdotnetmania.blogspot.com/feeds/7853866894627354194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://aspdotnetmania.blogspot.com/2011/09/4-small-but-important-tips-for-fresher.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/7853866894627354194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/7853866894627354194'/><link rel='alternate' type='text/html' href='http://aspdotnetmania.blogspot.com/2011/09/4-small-but-important-tips-for-fresher.html' title='4 Small But Important Tips For Fresher of Asp.net.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10409168669089194645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4yLT8ADVPkXpPtICECvGw1Dx12GxIQFz0LUCTAD_BXrNKjHT6sz-_PDXB2erizwGYj-2_KZRPNRQuQdoI408kzA44dlkVAiwCGZxKU2JgMGkcC7JOsJK_nvWP9ORnR3IhCez30uGIe2Q3/s72-c/4tipss.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5771365145222184138.post-1637889123911274704</id><published>2011-09-05T01:42:00.000-07:00</published><updated>2011-09-16T04:50:38.765-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ajax tips"/><title type='text'>Show/Hide ModalPopup Using Javascript.</title><content type='html'>&lt;div id=&quot;fb-root&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://connect.facebook.net/en_US/all.js#appId=121154747981512&amp;amp;xfbml=1&quot;&gt;
&lt;/script&gt;&lt;fb:like font=&quot;lucida grande&quot; href=&quot;http://www.facebook.com/pages/AspNet-With-C/150227715035982&quot; send=&quot;true&quot; show_faces=&quot;true&quot; width=&quot;450&quot;&gt;&lt;/fb:like&gt;&lt;/div&gt;


&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;The Asp.net Markup :&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;lt;asp:panel id=&quot;pnlDemo&quot; runat=&quot;server&quot; style=&quot;display: none;&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp;&amp;lt;h1&amp;gt;
This panel is a test demo&amp;lt;/h1&amp;gt;
&amp;lt;/asp:panel&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp;&amp;lt;cc1:modalpopupextender backgroundcssclass=&quot;modalBlockBackground&quot; behaviorid=&quot;ModalPopupExtender&quot; dynamicservicepath=&quot;&quot; enabled=&quot;True&quot; id=&quot;ModalPopupExtender&quot; popupcontrolid=&quot;pnlDemo&quot; runat=&quot;server&quot; targetcontrolid=&quot;linkButton1&quot;&amp;gt;
     &amp;lt;/cc1:modalpopupextender&amp;gt;


&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;If we want to use the javascript to control the popup, we can just simply to write the code like this:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt; if(!show)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; $find(&#39;ModalPopupExtender&#39;).hide();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; else&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $find(&quot;ModalPopupExtender&quot;).show();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There is one thing need to 
be taken care which is the BehavirID, the code in the Javasctipt will 
look for the BehaviorID property for the ModalPopupExtender.&lt;br /&gt;
&lt;br /&gt;
I hope this can be helpful for you.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;

&lt;div id=&quot;fb-root&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://connect.facebook.net/en_US/all.js#appId=121154747981512&amp;amp;xfbml=1&quot;&gt;
&lt;/script&gt;&lt;fb:like font=&quot;lucida grande&quot; href=&quot;http://www.facebook.com/pages/AspNet-With-C/150227715035982&quot; send=&quot;true&quot; show_faces=&quot;true&quot; width=&quot;450&quot;&gt;&lt;/fb:like&gt;&lt;/div&gt;

</content><link rel='replies' type='application/atom+xml' href='http://aspdotnetmania.blogspot.com/feeds/1637889123911274704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://aspdotnetmania.blogspot.com/2011/09/showhide-modalpopup-using-javascript.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/1637889123911274704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/1637889123911274704'/><link rel='alternate' type='text/html' href='http://aspdotnetmania.blogspot.com/2011/09/showhide-modalpopup-using-javascript.html' title='Show/Hide ModalPopup Using Javascript.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10409168669089194645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5771365145222184138.post-7173215319016389829</id><published>2011-09-01T22:32:00.000-07:00</published><updated>2011-09-16T04:50:47.000-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net Tips"/><title type='text'>3 Things Must You Know About C# Code.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div id=&quot;fb-root&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://connect.facebook.net/en_US/all.js#appId=121154747981512&amp;amp;xfbml=1&quot;&gt;
&lt;/script&gt;&lt;fb:like font=&quot;lucida grande&quot; href=&quot;http://www.facebook.com/pages/AspNet-With-C/150227715035982&quot; send=&quot;true&quot; show_faces=&quot;true&quot; width=&quot;450&quot;&gt;&lt;/fb:like&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1. Null Coalescing Operator (??)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
A new operator can be used which can be shortcut of ternary operator to check the null value:&lt;br /&gt;
&lt;br /&gt;
Ternary operator (?:):&lt;br /&gt;
&lt;br /&gt;
string empName = (value != null) ? value : string.Empty;&lt;br /&gt;
&lt;br /&gt;
we can write it using null-coalescing operator (??):&lt;br /&gt;
&lt;br /&gt;
string empName = value ?? string.Empty;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;2. The As Cast&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
we might have seen the code something like:&lt;br /&gt;
if (customer is DeluxCustomer)&lt;br /&gt;
{&lt;br /&gt;
var dCust = (DeluxCustomer)customer&lt;br /&gt;
// ...&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
This is redundant because we are checking the type twice. Once in the is check and once in the cast.&lt;br /&gt;
&lt;br /&gt;
We can use as operator in place. This will cast the type if the types are compatible, or return null if not:&lt;br /&gt;
var dCust = customer as DeluxCustomer;&lt;br /&gt;
// ... we can write if condition to check for null&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
we can avoid double-checking the type.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;3. Auto-Properties&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
This is the new concept to define the properties in C#: we can define the auto-property without much code:&lt;br /&gt;
public class Name&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
public int name { get; set; }&lt;br /&gt;
public int name { get; set; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;fb-root&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://connect.facebook.net/en_US/all.js#appId=121154747981512&amp;amp;xfbml=1&quot;&gt;
&lt;/script&gt;&lt;fb:like font=&quot;lucida grande&quot; href=&quot;http://www.facebook.com/pages/AspNet-With-C/150227715035982&quot; send=&quot;true&quot; show_faces=&quot;true&quot; width=&quot;450&quot;&gt;&lt;/fb:like&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aspdotnetmania.blogspot.com/feeds/7173215319016389829/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://aspdotnetmania.blogspot.com/2011/09/3-things-must-you-know-about-c-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/7173215319016389829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/7173215319016389829'/><link rel='alternate' type='text/html' href='http://aspdotnetmania.blogspot.com/2011/09/3-things-must-you-know-about-c-code.html' title='3 Things Must You Know About C# Code.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10409168669089194645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5771365145222184138.post-8162051989826694044</id><published>2011-08-19T03:15:00.000-07:00</published><updated>2013-10-14T22:25:04.264-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net Tips"/><title type='text'>How To Read Local Drive Information With Asp.net Application</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Some time we need to interact with the local file system, reading structure of the Directories, reading and writing files, or performing many other jobs.&lt;br /&gt;
&lt;br /&gt;
In this Application we need use System.IO Namespace for working with file system directories. System.IO Contain Driveinfo class.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC6NFoLeIg3NpvO0U3hpOC_egAAyZ071AaJPCkhT5M11oC7Gp4zjRLvn6IlacMsHP1aByWiidjR-76cMpOa8u-DiIpf8PfhbKQ6TFbmRluXvawW_CnRoUMsIzqUlSU2l2zcVz54ndxWyJA/s1600/SkyDrive+Explorer.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;169&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC6NFoLeIg3NpvO0U3hpOC_egAAyZ071AaJPCkhT5M11oC7Gp4zjRLvn6IlacMsHP1aByWiidjR-76cMpOa8u-DiIpf8PfhbKQ6TFbmRluXvawW_CnRoUMsIzqUlSU2l2zcVz54ndxWyJA/s320/SkyDrive+Explorer.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Driveinfo&lt;/b&gt; class is used to get information such us the name,type, and status of each drive.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;DriveInfo DriveDetails&lt;/b&gt;= new &lt;b&gt;DriveInfo&lt;/b&gt;(@&quot;C:\&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;DriveDetails&lt;/b&gt;.&lt;b&gt;Name &lt;/b&gt;: it is used to get the name of the specified drive.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;DriveDetails&lt;/b&gt;.&lt;b&gt;DriveType &lt;/b&gt;: it is used to get type of the specified drive.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;DriveDetails&lt;/b&gt;.&lt;b&gt;AvailableFreeSpace &lt;/b&gt;: it is used to get the available free space in the specified drive.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;DriveDetails&lt;/b&gt;.&lt;b&gt;TotalFreeSpace &lt;/b&gt;:it is used to get the total free space in the specified drive.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;DriveDetails&lt;/b&gt;.&lt;b&gt;TotalSize &lt;/b&gt;:it is used to get the total size in the specified drive.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;DriveDetails&lt;/b&gt;.&lt;b&gt;DriveFormat &lt;/b&gt;: it is used to get the format of the specified drive.&lt;br /&gt;
&lt;br /&gt;
Here I am Getting C drive Information such us Drive Name, Drive Type, Free Space, Drive Format, Total Free Space, Total Size.&lt;br /&gt;
&lt;br /&gt;
Here i am getting drive Size is in bytes. but i want result in Giga Bytes.&lt;br /&gt;
&lt;br /&gt;
1024 Bytes = 1 KiloByte(KB)&lt;br /&gt;
1024 KiloBytes(KB) = 1 MegaByte(MB)&lt;br /&gt;
1024 MegaBytes(MB) = 1 GigaByte(GB)&lt;br /&gt;
1024 GigaBytes(GB) = 1 TeraByte(TB) &lt;br /&gt;
&lt;br /&gt;
I am converting Bytes to Giga bytes.&lt;br /&gt;
&lt;br /&gt;
double db = Convert.ToDouble(lblTotalSize.Text);&lt;br /&gt;
double db1 = db / 1024;&lt;br /&gt;
double db2 = db1 / 1024;&lt;br /&gt;
int db3 = Convert.ToInt32(db2) / 1024;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
protected void Page_Load(object sender, EventArgs e)&lt;/div&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DriveInfo DriveDetails= new DriveInfo(@&quot;C:\&quot;);&lt;/div&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lblDriveName.Text = DriveDetails.Name;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lblDriveType.Text = DriveDetails.DriveType.ToString();&lt;/div&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lblFreeSpace.Text = DriveDetails.AvailableFreeSpace.ToString();&lt;/div&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lblDriveFormat.Text = DriveDetails.DriveFormat.ToString();&lt;/div&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lblTotalFreeSpace.Text = DriveDetails.TotalFreeSpace.ToString();&lt;/div&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lblTotalSize.Text = DriveDetails.TotalSize.ToString();&lt;/div&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double db = Convert.ToDouble(lblTotalSize.Text);&lt;/div&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double db1 = db / 1024;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double db2 = db1 / 1024;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int db3 = Convert.ToInt32(db2) / 1024;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lblTotalSizeInGb.Text = db3.ToString() + &quot; GB&quot;;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double TS = Convert.ToDouble(lblTotalFreeSpace.Text);&lt;/div&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double TS1 = TS / 1024;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double TS2 = TS1 / 1024;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int TS3 = Convert.ToInt32(TS2) / 1024;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lblTotalFreeSpaceGB.Text = TS3.ToString() + &quot; GB&quot;;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;Now you can understand about How to read Drive information from local System using Asp.Net Web application AND to calculate Bytes to Giga bytes in Web Application&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;If you find a bug and have a fix for it: please let me know and I&#39;ll be happy to update the code I am hosting here.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;Any suggestions will be appreciated greatly.&lt;/span&gt; &lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;fb-root&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://connect.facebook.net/en_US/all.js#appId=121154747981512&amp;amp;xfbml=1&quot;&gt;
&lt;/script&gt;&lt;fb:like font=&quot;lucida grande&quot; href=&quot;http://www.facebook.com/pages/AspNet-With-C/150227715035982&quot; send=&quot;true&quot; show_faces=&quot;true&quot; width=&quot;450&quot;&gt;&lt;/fb:like&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aspdotnetmania.blogspot.com/feeds/8162051989826694044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://aspdotnetmania.blogspot.com/2011/08/how-to-read-local-drive-information.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/8162051989826694044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/8162051989826694044'/><link rel='alternate' type='text/html' href='http://aspdotnetmania.blogspot.com/2011/08/how-to-read-local-drive-information.html' title='How To Read Local Drive Information With Asp.net Application'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10409168669089194645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC6NFoLeIg3NpvO0U3hpOC_egAAyZ071AaJPCkhT5M11oC7Gp4zjRLvn6IlacMsHP1aByWiidjR-76cMpOa8u-DiIpf8PfhbKQ6TFbmRluXvawW_CnRoUMsIzqUlSU2l2zcVz54ndxWyJA/s72-c/SkyDrive+Explorer.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5771365145222184138.post-2324253676640084285</id><published>2011-02-05T23:53:00.000-08:00</published><updated>2011-09-13T03:54:10.318-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Sql Tips"/><title type='text'>varchar Vs. nvarchar</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;m:smallfrac m:val=&quot;off&quot;&gt;    &lt;m:dispdef&gt;    &lt;m:lmargin m:val=&quot;0&quot;&gt;    &lt;m:rmargin m:val=&quot;0&quot;&gt;    &lt;m:defjc m:val=&quot;centerGroup&quot;&gt;    &lt;m:wrapindent m:val=&quot;1440&quot;&gt;    &lt;m:intlim m:val=&quot;subSup&quot;&gt;    &lt;m:narylim m:val=&quot;undOvr&quot;&gt;   &lt;/m:narylim&gt;&lt;/m:intlim&gt; &lt;/m:wrapindent&gt;  &lt;/m:defjc&gt;&lt;/m:rmargin&gt;&lt;/m:lmargin&gt;&lt;/m:dispdef&gt;&lt;/m:smallfrac&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span class=&quot;comment-copy&quot;&gt;char, nchar, varchar, and nvarchar each take a length parameter which the database engine can use to optimize storage.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span class=&quot;comment-copy&quot;&gt;UTF-16 (when sticking to the BMP) has a simple two-to-one relationship between bytes of storage and characters, which the database can take advantage of.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span class=&quot;comment-copy&quot;&gt;The amount of storage required for a UTF-8 string of N characters is not as clear, and could result in wasted space, or unexpectedly truncated strings.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-size: 12pt;&quot;&gt;varchar does not store ASCII, it stores an 8-bit encoding.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;nvarchar and varchar do not &quot;function identically&quot; since varchar does not function at all in lots of scenarios.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;varchar contain max size 8000 while nvarchar size is 4000.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;nvarchar may take up twice as much space, but varchar is twice as slow, since it requires string conversions for every read and write (on those occasions when it actually works).&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;fb-root&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://connect.facebook.net/en_US/all.js#appId=121154747981512&amp;amp;xfbml=1&quot;&gt;
&lt;/script&gt;&lt;fb:like font=&quot;lucida grande&quot; href=&quot;http://www.facebook.com/pages/AspNet-With-C/150227715035982&quot; send=&quot;true&quot; show_faces=&quot;true&quot; width=&quot;450&quot;&gt;&lt;/fb:like&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aspdotnetmania.blogspot.com/feeds/2324253676640084285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://aspdotnetmania.blogspot.com/2011/02/varchar-vs-nvarchar.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/2324253676640084285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/2324253676640084285'/><link rel='alternate' type='text/html' href='http://aspdotnetmania.blogspot.com/2011/02/varchar-vs-nvarchar.html' title='varchar Vs. nvarchar'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10409168669089194645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5771365145222184138.post-5237601270843641599</id><published>2010-08-19T19:44:00.000-07:00</published><updated>2011-09-13T03:54:30.831-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ajax tips"/><title type='text'>About AJAX !!</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;What is Ajax ??&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
Ajax is a way of developing Web applications that combines:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * XHTML and CSS standards based presentation&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Interaction with the page through the DOM&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Data interchange with XML and XSLT&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Asynchronous data retrieval with XMLHttpRequest&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * JavaScript to tie it all together&lt;br /&gt;
&lt;br /&gt;
In the traditional Web application, the interaction between the customer and the server goes like this:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; 1. Customer accesses Web application&lt;br /&gt;
&amp;nbsp;&amp;nbsp; 2. Server processes request and sends data to the browser while the customer waits&lt;br /&gt;
&amp;nbsp;&amp;nbsp; 3. Customer clicks on a link or interacts with the application&lt;br /&gt;
&amp;nbsp;&amp;nbsp; 4. Server processes request and sends data back to the browser while the customer waits&lt;br /&gt;
&amp;nbsp;&amp;nbsp; 5. etc....&lt;br /&gt;
&lt;br /&gt;
There is a lot of customer waiting.&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Ajax Acts as an Intermediary&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;The Ajax engine works within the Web browser (through JavaScript and the DOM) to render the Web application and handle any requests that the customer might have of the Web server. The beauty of it is that because the Ajax engine is handling the requests, it can hold most information in the engine itself, while allowing the interaction with the application and the customer to happen asynchronously and independently of any interaction with the server.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Asynchronous&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;This is the key. In standard Web applications, the interaction between the customer and the server is synchronous. This means that one has to happen after the other. If a customer clicks a link, the request is sent to the server, which then sends the results back.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;With Ajax, the JavaScript that is loaded when the page loads handles most of the basic tasks such as data validation and manipulation, as well as display rendering the Ajax engine handles without a trip to the server. At the same time that it is making display changes for the customer, it is sending data back and forth to the server. But the data transfer is not dependent upon actions of the customer.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Ajax is Not New Technology&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Ajax is instead a new way of looking at technology that is already mature and stable. If you&#39;re designing Web applications right now, why aren&#39;t you using Ajax? Your customers will thank you, and frankly, it&#39;s just fun&lt;/span&gt;!&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
That&#39;s It ..!!&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;fb-root&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://connect.facebook.net/en_US/all.js#appId=121154747981512&amp;amp;xfbml=1&quot;&gt;
&lt;/script&gt;&lt;fb:like font=&quot;lucida grande&quot; href=&quot;http://www.facebook.com/pages/AspNet-With-C/150227715035982&quot; send=&quot;true&quot; show_faces=&quot;true&quot; width=&quot;450&quot;&gt;&lt;/fb:like&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aspdotnetmania.blogspot.com/feeds/5237601270843641599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://aspdotnetmania.blogspot.com/2010/08/about-ajax.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/5237601270843641599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/5237601270843641599'/><link rel='alternate' type='text/html' href='http://aspdotnetmania.blogspot.com/2010/08/about-ajax.html' title='About AJAX !!'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10409168669089194645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5771365145222184138.post-95344279791475406</id><published>2010-08-19T00:05:00.000-07:00</published><updated>2011-09-13T03:54:47.070-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net Tips"/><title type='text'>How to Store Values In View State..??</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
ASP.NET has a built in mechanism for storing values of controls known as ViewState. &lt;br /&gt;
The ViewState property provides a key-value object for storing values between multiple requests of the same page. &lt;br /&gt;
ASP.NET saves the state of the page and controls as a hashed string in the page as a hidden variable, ViewState.&lt;br /&gt;
When a page is run, the ViewState property can be seen from the source code of the page.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;color: purple;&quot;&gt;&lt;span style=&quot;color: purple;&quot;&gt;&amp;lt;input type=&quot;hidden&quot; name=&quot;__EVENTVALIDATION&quot; id=&quot;__EVENTVALIDATION&quot; &lt;/span&gt;
&lt;span style=&quot;color: purple;&quot;&gt;value=&quot;/wEWAgL3ku32BwLs0bLrBqcPjj4o1kvxlT2D91sy/YSkJDTh&quot; /&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Custom data can be stored in the ViewState property. &lt;br /&gt;
&lt;br /&gt;
If a value has to be stored for a user in page, ViewState is an easy way to achieve this. &lt;br /&gt;
Please note that ViewState property is only accessible from the page only. &lt;br /&gt;
If the user visits a different page, the ViewState property will be lost.&lt;br /&gt;
&lt;br /&gt;
Let&#39;s create a string containing a date and store it in the ViewState.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;color: purple;&quot;&gt;&lt;span style=&quot;color: purple;&quot;&gt;string date = DateTime.Now.ToString();&lt;/span&gt;

&lt;span style=&quot;color: purple;&quot;&gt;ViewState[&quot;date&quot;] = date;&lt;/span&gt;

&lt;span style=&quot;color: purple;&quot;&gt;An alternative way of achieving this would be to&lt;/span&gt;


&lt;span style=&quot;color: purple;&quot;&gt;ViewState.Add(&quot;date&quot;, date);&lt;/span&gt;


&lt;span style=&quot;color: purple;&quot;&gt;The values stored in the ViewState can also be retrieved as follows.&lt;/span&gt;


&lt;span style=&quot;color: purple;&quot;&gt;if ((string)ViewState[&quot;date&quot;] != null)&lt;/span&gt;

&lt;span style=&quot;color: purple;&quot;&gt;{&lt;/span&gt;

&lt;span style=&quot;color: purple;&quot;&gt;string date2 = (string)ViewState[&quot;date&quot;];&lt;/span&gt;

&lt;span style=&quot;color: purple;&quot;&gt;}&lt;/span&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&lt;/span&gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, I am checking there a ViewState property named &quot;date&quot;. If so, assign the value to string date2.&lt;br /&gt;
In ViewState, objects can also be stored/ For example, we can store a DateTime object like below&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;ViewState.Add(&quot;date3&quot;, DateTime.Now);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
and retrieve the object like&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;DateTime date3 = (DateTime)ViewState[&quot;date3&quot;];&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&#39;s It....!!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;fb-root&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://connect.facebook.net/en_US/all.js#appId=121154747981512&amp;amp;xfbml=1&quot;&gt;
&lt;/script&gt;&lt;fb:like font=&quot;lucida grande&quot; href=&quot;http://www.facebook.com/pages/AspNet-With-C/150227715035982&quot; send=&quot;true&quot; show_faces=&quot;true&quot; width=&quot;450&quot;&gt;&lt;/fb:like&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aspdotnetmania.blogspot.com/feeds/95344279791475406/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://aspdotnetmania.blogspot.com/2010/08/how-to-store-values-in-view-state.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/95344279791475406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/95344279791475406'/><link rel='alternate' type='text/html' href='http://aspdotnetmania.blogspot.com/2010/08/how-to-store-values-in-view-state.html' title='How to Store Values In View State..??'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10409168669089194645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5771365145222184138.post-38636254994898665</id><published>2010-07-11T04:32:00.000-07:00</published><updated>2011-09-13T03:57:17.135-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net Tips"/><title type='text'>C#.net Interview Question &amp; Answer...!!</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 13.5pt;&quot;&gt;General Questions&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol start=&quot;1&quot; type=&quot;1&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Does C# support multiple-inheritance?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt; &lt;br /&gt;
No.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Who is a protected class-level variable available to? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;It is available to any       sub-class (a class inheriting this class).&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Are private class-level variables inherited? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Yes, but they are not       accessible.&amp;nbsp; Although they are not visible or accessible via  the      class interface, they are inherited.&amp;nbsp; &lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=5771365145222184138&quot; name=&quot;more&quot;&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt; &lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Describe the accessibility modifier “protected       internal”. &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;It is available to  classes that      are within the same assembly and derived from the  specified&amp;nbsp;base      class.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What’s the top .NET class that everything is derived       from? &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
System.Object.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What does the term immutable mean?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&lt;br /&gt;
The data value may not be changed.&amp;nbsp; Note: The &lt;i&gt;variable&lt;/i&gt; value       may be changed, but the original immutable data value was  discarded and a      new data value was created in memory.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What’s the difference between System.String and       System.Text.StringBuilder classes?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&lt;br /&gt;
System.String is immutable.&amp;nbsp; System.StringBuilder was designed with       the purpose of having a mutable string where a variety of  operations can      be performed.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What’s the advantage of using  System.Text.StringBuilder      over System.String?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&lt;br /&gt;
StringBuilder is more efficient in cases where there is a large amount  of      string manipulation.&amp;nbsp; Strings are immutable, so each time a  string is      changed,&amp;nbsp;a new instance in memory is created.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Can you store multiple data types in System.Array?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&lt;br /&gt;
No.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What’s the difference between the  System.Array.CopyTo()      and System.Array.Clone()?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;The Clone() method  returns a      new array (a shallow copy) object containing all the  elements in the      original array.&amp;nbsp; The CopyTo() method copies  the elements into another      existing array.&amp;nbsp; Both perform a  shallow copy.&amp;nbsp; A shallow copy      means the contents (each array  element) contains references to the same      object as the elements in  the original array.&amp;nbsp; A deep copy (which      neither of these  methods performs) would create a new instance of each      element&#39;s  object, resulting in a different, yet identacle object.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;How can you sort the elements of the array in       descending order?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;By calling Sort() and  then      Reverse() methods.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What’s the .NET collection&amp;nbsp;class that allows an       element to be accessed using a unique key?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;HashTable.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What class is underneath the SortedList class?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;A sorted HashTable.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Will the finally block get executed if an exception  has      not occurred?­&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Yes. &lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What’s the C# syntax to catch any possible exception?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;A catch block that  catches the      exception of type System.Exception.&amp;nbsp; You can also  omit the parameter      data type in this case and just write catch {}.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Can multiple catch blocks be executed for a single try       statement?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;No.&amp;nbsp; Once the  proper catch      block processed, control is transferred to the finally  block (if there are      any).&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Explain the three services model commonly know as a       three-tier application.&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Presentation (UI),  Business      (logic and underlying code) and Data (from storage or  other      sources).&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 13.5pt;&quot;&gt;Class Questions&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol start=&quot;1&quot; type=&quot;1&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What is the syntax to inherit from a class in C#? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Place a colon and then  the name      of the base class.&lt;br /&gt;
Example: &lt;i&gt;class MyNewClass : MyBaseClass&lt;/i&gt;&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Can you prevent your class from being inherited by       another class? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Yes.&amp;nbsp; The keyword  “sealed”      will prevent the class from being inherited.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Can you allow a class to be inherited, but prevent the       method from being over-ridden?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Yes.&amp;nbsp; Just leave  the class      public and make the method sealed.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What’s an abstract class?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;A class that cannot be       instantiated. &amp;nbsp;An abstract class is a class that must be  inherited      and have the methods overridden. &amp;nbsp;An abstract class  is essentially a      blueprint for a class without any implementation.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;When do you absolutely have to declare a class as       abstract?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
1. When the class itself is inherited from an abstract class, but not  all      base abstract methods have been overridden. &lt;br /&gt;
2.&amp;nbsp; When at least one of the methods in the class is abstract.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What is an interface class?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Interfaces, like  classes,      define a set of properties, methods, and events. But  unlike classes,      interfaces do not provide implementation. They are  implemented by classes,      and defined as separate entities from  classes.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Why can’t you specify the accessibility modifier for       methods inside the interface?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;They all must be  public, and      are therefore public by default.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Can you inherit multiple interfaces?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Yes.&amp;nbsp; .NET does  support      multiple interfaces.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What happens if you inherit multiple interfaces and       they have conflicting method names?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;It’s up to you to  implement the      method inside your own class, so implementation is  left entirely up to      you. This might cause a problem on a  higher-level scale if similarly named      methods from different  interfaces expect different data, but as far as      compiler cares  you’re okay. &lt;br /&gt;
&lt;b&gt;To Do:&lt;/b&gt; Investigate&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What’s the difference between an interface and  abstract      class?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;In an interface class,  all      methods are abstract - there is no implementation.&amp;nbsp; In an  abstract      class some methods can be concrete. &amp;nbsp;In an interface  class, no      accessibility modifiers are allowed.&amp;nbsp; An abstract  class may have      accessibility modifiers.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What is the difference between a Struct and a Class?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&lt;br /&gt;
Structs are value-type variables and are thus saved on the stack,       additional overhead but faster retrieval.&amp;nbsp; Another difference is  that      structs&amp;nbsp;&lt;b&gt;cannot&lt;/b&gt; inherit.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 13.5pt;&quot;&gt;Method and Property Questions&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol start=&quot;1&quot; type=&quot;1&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What’s the implicit name of the parameter that gets       passed into the set method/property of a class? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Value.&amp;nbsp; The data  type of      the value parameter is defined by whatever data type the  property is      declared as.&lt;a href=&quot;http://www.blogger.com/post-create.do&quot; name=&quot;more55&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What does the keyword “virtual” declare for a method  or      property? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;The method or property  can be      overridden.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;How is method overriding different from method       overloading? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;When overriding a  method, you      change the behavior of the method for the derived  class.&amp;nbsp; Overloading      a method simply involves having another  method with the same name within      the class.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Can you declare an override method to be static if the       original method is not static? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;No.&amp;nbsp; The signature  of the      virtual method must remain the same.&amp;nbsp; (Note: Only the  keyword virtual      is changed to keyword override)&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What are the different ways a method can be  overloaded?      &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Different parameter  data types,      different number of parameters, different order of  parameters.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;If a base class has a number of overloaded       constructors, and an&amp;nbsp;inheriting class has a number of overloaded       constructors; can you enforce a call from an inherited constructor to  a      specific base constructor?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Yes, just place a  colon, and      then keyword base (parameter list to invoke the  appropriate constructor)      in the overloaded constructor definition  inside the inherited class.&lt;br /&gt;
&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 13.5pt;&quot;&gt;Events and Delegates&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol start=&quot;1&quot; type=&quot;1&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What’s a delegate? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;A delegate object  encapsulates      a reference to a method.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What’s a multicast delegate? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;A delegate that has  multiple      handlers assigned to it.&amp;nbsp; Each assigned handler  (method) is called.&lt;br /&gt;
&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 13.5pt;&quot;&gt;XML Documentation Questions &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol start=&quot;1&quot; type=&quot;1&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Is XML case-sensitive? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Yes.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What’s the difference between // comments, /* */       comments and /// comments? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Single-line comments,       multi-line comments, and XML documentation comments.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;How do you generate documentation from the C# file       commented properly with a command-line compiler? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Compile it with the  /doc      switch.&lt;br /&gt;
&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 13.5pt;&quot;&gt;Debugging and Testing Questions &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol start=&quot;1&quot; type=&quot;1&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What debugging tools come with the .NET SDK?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&lt;br /&gt;
1.&amp;nbsp;&amp;nbsp; CorDBG – command-line debugger.&amp;nbsp; To use CorDbg, you       must compile the original C# file using the /debug switch. &lt;br /&gt;
2.&amp;nbsp;&amp;nbsp; DbgCLR – graphic debugger. &amp;nbsp;Visual Studio .NET uses       the DbgCLR.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What does assert() method do? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;In debug compilation,  assert      takes in a Boolean condition as a parameter, and shows the  error dialog if      the condition is false. &amp;nbsp;The program proceeds  without any      interruption if the condition is true.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What’s the difference between the Debug class and  Trace      class? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Documentation looks the  same.      &amp;nbsp;Use Debug class for debug builds, use Trace class for  both debug and      release builds.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Why are there five tracing levels in  System.Diagnostics.TraceSwitcher?      &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;The tracing dumps can  be quite      verbose.&amp;nbsp; For applications that are constantly  running you run the      risk of overloading the machine and the hard  drive. &amp;nbsp;Five levels      range from None to Verbose, allowing you  to fine-tune the tracing      activities.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Where is the output of TextWriterTraceListener       redirected?&lt;/span&gt;&lt;/b&gt; &lt;br /&gt;
To the Console or a text file depending on the parameter passed to the       constructor.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;How do you debug an ASP.NET Web application?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt; &lt;br /&gt;
Attach the aspnet_wp.exe process to the DbgClr debugger.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What are three test cases you should go through in  unit      testing? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;       Positive test cases (correct data, correct output).&lt;br /&gt;
2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Negative test cases (broken or       missing data, proper handling).&lt;br /&gt;
3.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exception test cases (exceptions       are thrown and caught properly).&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Can you change the value of a variable while debugging       a C# application? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Yes.&amp;nbsp; If you are  debugging      via Visual Studio.NET, just go to Immediate window.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 13.5pt;&quot;&gt;ADO.NET and Database Questions &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol start=&quot;1&quot; type=&quot;1&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What is the role of the DataReader class in ADO.NET       connections? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;It returns a read-only,       forward-only rowset from the data source.&amp;nbsp; A DataReader  provides fast      access when a forward-only sequential read is needed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0in 0in 0.0001pt 0.5in;&quot;&gt;
&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;ol start=&quot;2&quot; type=&quot;1&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;What are advantages  and disadvantages of       Microsoft-provided data provider classes in ADO.NET? &lt;br /&gt;
&lt;/b&gt;SQLServer.NET data  provider is      high-speed and robust, but requires SQL Server license  purchased from      Microsoft. OLE-DB.NET is universal for accessing  other sources, like      Oracle, DB2, Microsoft Access and  Informix.&amp;nbsp; OLE-DB.NET is a .NET      layer on top of the OLE layer,  so it’s not as fastest and efficient as      SqlServer.NET.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What is the wildcard character in SQL? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Let’s say you want to  query      database with LIKE for all employees whose name starts with  La. The      wildcard character is %, the proper query with LIKE would  involve      ‘La%’.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Explain ACID rule of thumb for transactions.&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;A transaction must be:&lt;br /&gt;
1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Atomic - it is one unit of work  and      does not dependent on previous and following transactions.&lt;br /&gt;
2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Consistent - data is either       committed or roll back, no “in-between” case where something has been       updated and something hasn’t.&lt;br /&gt;
3.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Isolated - no transaction sees  the      intermediate results of the current transaction).&lt;br /&gt;
4.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Durable - the values persist if  the      data had been committed even if the system crashes right after.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What connections does Microsoft SQL Server support? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Windows Authentication  (via      Active Directory) and SQL Server authentication (via Microsoft  SQL Server      username and password).&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Between Windows Authentication and SQL Server       Authentication, which one is trusted and which one is untrusted?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt; &lt;br /&gt;
Windows Authentication is trusted because the username and password are       checked with the Active Directory, the SQL Server authentication is       untrusted, since SQL Server is the only verifier participating in  the      transaction.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What does the Initial Catalog parameter define in the       connection string?&lt;/span&gt;&lt;/b&gt; &lt;br /&gt;
The database name to connect to.&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What does the Dispose method do with the connection       object? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Deletes it from the  memory.&lt;br /&gt;
&lt;b&gt;To Do:&lt;/b&gt; answer better.&amp;nbsp; The current answer is not entirely       correct.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What is a pre-requisite for connection pooling?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt; &lt;br /&gt;
Multiple processes must agree that they will share the same connection,       where every parameter is the same, including the security  settings.&amp;nbsp;      The connection string must be identical.&lt;br /&gt;
&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 13.5pt;&quot;&gt;Assembly Questions &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol start=&quot;1&quot; type=&quot;1&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;How is the DLL Hell problem solved in .NET? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Assembly versioning  allows the      application to specify not only the library it needs to  run (which was      available under Win32), but also the version of the  assembly.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What are the ways to deploy an assembly? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;An MSI installer, a CAB       archive, and XCOPY command.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What is a satellite assembly?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt; &lt;br /&gt;
When you write a multilingual or multi-cultural application in .NET, and       want to distribute the core application separately from the  localized      modules, the localized assemblies that modify the core  application are      called satellite assemblies.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What namespaces are necessary to create a localized       application? &lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;System.Globalization  and System.Resources.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What is the smallest unit of execution in .NET?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&lt;br /&gt;
an Assembly.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;When should you call the garbage collector in .NET?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&lt;br /&gt;
As a good rule, you should not call the garbage collector.&amp;nbsp;  However,      you&amp;nbsp;could call the garbage collector when you are  done using a large      object (or set of objects) to force the garbage  collector to dispose of      those very large objects from memory.&amp;nbsp;  However, this is usually not a      good practice.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;How do you convert a value-type to a reference-type?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&lt;br /&gt;
Use Boxing.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What&amp;nbsp;happens in memory when you&amp;nbsp;Box and  Unbox      a value-type?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Boxing converts&amp;nbsp;a value-type to a reference-type, thus storing the       object on the heap.&amp;nbsp; Unboxing converts a reference-type to a       value-type, thus storing the value on the stack.&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;fb-root&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://connect.facebook.net/en_US/all.js#appId=121154747981512&amp;amp;xfbml=1&quot;&gt;
&lt;/script&gt;&lt;fb:like font=&quot;lucida grande&quot; href=&quot;http://www.facebook.com/pages/AspNet-With-C/150227715035982&quot; send=&quot;true&quot; show_faces=&quot;true&quot; width=&quot;450&quot;&gt;&lt;/fb:like&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aspdotnetmania.blogspot.com/feeds/38636254994898665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://aspdotnetmania.blogspot.com/2010/07/cnet-interview-question-answer.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/38636254994898665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/38636254994898665'/><link rel='alternate' type='text/html' href='http://aspdotnetmania.blogspot.com/2010/07/cnet-interview-question-answer.html' title='C#.net Interview Question &amp; Answer...!!'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10409168669089194645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5771365145222184138.post-1793007671931822879</id><published>2010-07-11T04:09:00.000-07:00</published><updated>2011-09-13T03:58:38.614-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net Tips"/><title type='text'>Asp.net Interview Question.....!!</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;
There are some  questions in this list that I do not consider to be good questions for  an interview.&amp;nbsp; However, they do exist on other lists available on the  Internet so I felt compelled to keep them here for easy access.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;ol start=&quot;1&quot; type=&quot;1&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Describe the role of &lt;i&gt;inetinfo.exe, aspnet_isapi.dll  &lt;/i&gt;and&lt;i&gt;aspnet_wp.exe&lt;/i&gt;      in the page loading process&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;.&lt;br /&gt;
inetinfo.exe is theMicrosoft IIS server running, handling ASP.NET  requests      among other things.When an ASP.NET request is received  (usually a file      with .aspx extension), the ISAPI filter  aspnet_isapi.dll takes care of it      by passing the request tothe  actual worker process aspnet_wp.exe.&lt;br /&gt;
&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What’s the difference between Response.Write()       andResponse.Output.Write()?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Response.Output.Write()  allows      you to write formatted output.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What methods are fired during the page load?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Init() - when the page  is      instantiated&lt;br /&gt;
Load() - when the page is loaded into server memory&lt;br /&gt;
PreRender() - the brief moment before the page is displayed to the user  as      HTML&lt;br /&gt;
Unload() - when page finishes loading.&lt;br /&gt;
&amp;nbsp; 
&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=5771365145222184138&quot; name=&quot;more&quot;&gt;&lt;/a&gt;       &lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;When during the page processing cycle is&amp;nbsp;ViewState       available?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
After the Init() and before the Page_Load(), or OnLoad() for a       control.&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What namespace does the Web page belong in the .NET       Framework class hierarchy?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;System.Web.UI.Page&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Where do you store the information about the user’s       locale?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;System.Web.UI.Page.Culture&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What’s the difference between       Codebehind=&quot;MyCode.aspx.cs&quot; andSrc=&quot;MyCode.aspx.cs&quot;?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;CodeBehind is relevant  to      Visual Studio.NET only.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What’s a bubbled event?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;When you have a complex       control, like DataGrid, writing an event processing routine for  each      object (cell, button, row, etc.) is quite tedious. The  controls can bubble      up their eventhandlers, allowing the main  DataGrid event handler to take      care of its constituents.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Suppose you want a certain ASP.NET function executed  on      MouseOver&amp;nbsp;for a&amp;nbsp;certain button.&amp;nbsp; Where do you add an event       handler?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Add an OnMouseOver  attribute to      the button.&amp;nbsp; Example:       btnSubmit.Attributes.Add(&quot;onmouseover&quot;,&quot;someClientCodeHere();&quot;);&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What data types do the RangeValidator control support?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Integer, String, and       Date.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Explain the differences between Server-side and       Client-side code?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Server-side code  executes on      the server.&amp;nbsp; Client-side code executes&amp;nbsp;in the       client&#39;s&amp;nbsp;browser.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What type of code (server or client) is found in a       Code-Behind class?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;The answer is  server-side code      since code-behind is executed on the server.&amp;nbsp;  However, during the      code-behind&#39;s execution on the server, it&amp;nbsp;can  render client-side      code&amp;nbsp;such as&amp;nbsp;JavaScript to be&amp;nbsp;processed&amp;nbsp;in the  clients      browser.&amp;nbsp; But just to be clear, code-behind executes on the  server,      thus making it server-side code.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Should user input data validation occur server-side or       client-side? &amp;nbsp;Why?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;All user input data  validation      should occur on the server at a minimum.&amp;nbsp; Additionally,  client-side      validation can be performed where deemed appropriate  and feasable to      provide a richer, more responsive experience for  the user.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What is the difference between Server.Transfer and       Response.Redirect? &amp;nbsp;Why would I choose one over the other?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Server.Transfer  transfers page      processing from&amp;nbsp;one page&amp;nbsp;directly to the next page  without      making a round-trip back to the client&#39;s browser.&amp;nbsp; This  provides a      faster response with a little less overhead on the  server.&amp;nbsp; Server.Transfer      does not update the clients&amp;nbsp;url  history&amp;nbsp;list or current      url.&amp;nbsp; Response.Redirect is used to redirect  the user&#39;s      browser&amp;nbsp;to another page or site.&amp;nbsp; This performas a trip  back to      the client where the client&#39;s browser is redirected to the  new page.&amp;nbsp;      The user&#39;s browser history list is updated to reflect  the new      address.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Can you explain the difference between an ADO.NET       Dataset and an ADO Recordset?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Valid answers are:&lt;br /&gt;
·&amp;nbsp; A DataSet can represent an entire relational database in memory,       complete with tables, relations, and views.&lt;br /&gt;
·&amp;nbsp; A DataSet is designed to work without any continuing connection to       the original data source.&lt;br /&gt;
·&amp;nbsp; Data in a DataSet is bulk-loaded, rather than being loaded on       demand.&lt;br /&gt;
·&amp;nbsp; There&#39;s no concept of cursor types in a DataSet.&lt;br /&gt;
·&amp;nbsp; DataSets have no current record pointer You can use For Each loops       to move through the data.&lt;br /&gt;
·&amp;nbsp; You can store many edits in a DataSet, and write them to the       original data source in a single operation.&lt;br /&gt;
·&amp;nbsp; Though the DataSet is universal, other objects in ADO.NET come in       different versions for different data sources.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What is the Global.asax used for?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;The Global.asax  (including the      Global.asax.cs file) is used to implement  application and session level      events.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What&amp;nbsp;are the Application_Start and Session_Start       subroutines used for?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;This is where you can  set the      specific variables for the Application and Session objects.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Can you explain what inheritance is and an example of       when you might use it?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;When you want to  inherit (use      the functionality of) another class. &amp;nbsp;Example: With  a&amp;nbsp;base class      named Employee, a Manager class could be derived from  the Employee base      class.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Whats an assembly?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Assemblies are the  building      blocks of the .NET framework.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Describe the difference between inline and code  behind.&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Inline code written  along side      the html in a page. Code-behind is code written in a  separate file and      referenced by the .aspx page.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Explain what a diffgram is, and a good use for one?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;The DiffGram is one of  the two      XML formats that you can use to render DataSet object  contents to      XML.&amp;nbsp; A good use is&amp;nbsp;reading database data to an XML  file to be      sent to a Web Service.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Whats MSIL, and why should my developers need an       appreciation of it if at all?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;MSIL is the Microsoft       Intermediate Language. All .NET compatible languages will get  converted to      MSIL.&amp;nbsp; MSIL also allows the .NET Framework to JIT  compile the      assembly on the installed computer.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Which method do you invoke on the DataAdapter control       to load your generated dataset with data?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;The Fill() method.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Can you edit data in the Repeater control?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;No, it just reads the       information from its data source&lt;b&gt;.&lt;/b&gt;&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Which template must you provide, in order to display       data in a Repeater control?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;ItemTemplate.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;How can you provide an alternating color scheme in a       Repeater control?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Use the  AlternatingItemTemplate&lt;b&gt;.&lt;/b&gt;&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What property must you set, and what method must you       call in your code, in order to bind the data from a&amp;nbsp;data source to       the Repeater control?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;You must set the  DataSource      property and call the DataBind method.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What base class do all Web Forms inherit from?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;The Page class.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Name two properties common in every validation  control?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;ControlToValidate  property and      Text property.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Which property on a Combo Box do you set with a column       name, prior to setting the DataSource, to display data in the  combo box?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;DataTextField property.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Which control would you use if you needed to make sure       the values in two different controls matched?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;CompareValidator  control.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;How many classes can a single .NET DLL contain?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;It can contain many  classes.&lt;br /&gt;
&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 13.5pt;&quot;&gt;Web Service Questions&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol start=&quot;1&quot; type=&quot;1&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What is the transport protocol you use to call a Web       service?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;SOAP&amp;nbsp;(Simple Object  Access      Protocol) is the preferred protocol.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;True or False: A Web service can only be written in       .NET?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;False&lt;b&gt;&lt;br /&gt;
&amp;nbsp;&lt;/b&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What does WSDL stand for?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Web Services  Description Language.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;Where on the Internet would you look for Web services?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;from&amp;nbsp; uddi.org&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;True or False: To test a Web service you must create a       Windows application or Web application to consume this service?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;False, the web service  comes      with a test page and it provides HTTP-GET method to test.&lt;br /&gt;
&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 13.5pt;&quot;&gt;State Management Questions&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol start=&quot;1&quot; type=&quot;1&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What is ViewState?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;ViewState allows the  state of      objects (serializable) to be stored in a hidden field on  the page.&amp;nbsp;      ViewState is transported to the client and back to the  server, and is not      stored on the server or any other external  source.&amp;nbsp; ViewState is used      the retain the state of server-side  objects between postabacks.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What is the lifespan for items stored in ViewState?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;Item stored in  ViewState exist      for the life of the current page.&amp;nbsp; This includes  postbacks (to the      same page).&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What does the &quot;EnableViewState&quot; property      do?&amp;nbsp; Why  would I want it on or off?&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;It allows the page to  save the      users input on a form across postbacks.&amp;nbsp; It saves the  server-side      values for a given control into ViewState, which is  stored as a hidden      value on the page before sending the page to the  clients      browser.&amp;nbsp;&amp;nbsp;When the page is posted back to the server the  server      control is recreated&amp;nbsp;with the state stored in viewstate.&lt;br /&gt;
&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;What are the different types of Session state       management options available with ASP.NET?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&lt;br /&gt;
ASP.NET provides In-Process and Out-of-Process state management.&amp;nbsp;       In-Process stores the session in memory on the web server.&amp;nbsp; This       requires the a &quot;sticky-server&quot; (or no load-balancing) so that      the  user is always reconnected to the same web server.&amp;nbsp;      Out-of-Process  Session state management stores data in an external data      source.&amp;nbsp;  The external data source may be either a SQL Server or a      State  Server service.&amp;nbsp; Out-of-Process state management requires that      all  objects stored in session are serializable.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;fb-root&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://connect.facebook.net/en_US/all.js#appId=121154747981512&amp;amp;xfbml=1&quot;&gt;
&lt;/script&gt;&lt;fb:like font=&quot;lucida grande&quot; href=&quot;http://www.facebook.com/pages/AspNet-With-C/150227715035982&quot; send=&quot;true&quot; show_faces=&quot;true&quot; width=&quot;450&quot;&gt;&lt;/fb:like&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://aspdotnetmania.blogspot.com/feeds/1793007671931822879/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://aspdotnetmania.blogspot.com/2010/07/aspnet-interview-question.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/1793007671931822879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5771365145222184138/posts/default/1793007671931822879'/><link rel='alternate' type='text/html' href='http://aspdotnetmania.blogspot.com/2010/07/aspnet-interview-question.html' title='Asp.net Interview Question.....!!'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10409168669089194645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry></feed>