<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3120602423723919508</id><updated>2012-02-17T03:37:00.999+05:30</updated><category term='c#'/><category term='BreakPoint'/><category term='Unit testing'/><category term='.net exception'/><category term='OOPS'/><category term='SQL Server'/><category term='Difference'/><category term='Debug'/><category term='Routing'/><category term='blinking cursor textbox'/><category term='C# 3.5 new feature'/><category term='One Line Defination'/><category term='ASP.NET'/><category term='ASP.NET Paths'/><category term='HTML 5'/><title type='text'>Ravi Pahuja - Share your experiences</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>34</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-8889722762643610451</id><published>2011-08-10T21:03:00.003+05:30</published><updated>2011-08-18T17:40:26.705+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>Object are passed by reference</title><content type='html'>Passing values in c# is really misunderstood by many people.&lt;br /&gt;&lt;br /&gt;Let's understand this concept by few examples:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;StringBuilder first = &lt;span class="Keyword"&gt;new&lt;/span&gt; StringBuilder();&lt;br /&gt;StringBuilder second = first;&lt;br /&gt;first.Append (&lt;span class="String"&gt;"hello"&lt;/span&gt;);&lt;br /&gt;first = &lt;span class="Keyword"&gt;null&lt;/span&gt;;&lt;br /&gt;Console.WriteLine (second);&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;Output: Hello&lt;br /&gt;&lt;br /&gt;When we assign reference to second of first, we are acutally assigning the object reference contact by first. So when we set first to null, now first is not refering to any object, however second is still referening to that object. &lt;br /&gt;&lt;br /&gt;Now&lt;br /&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;&lt;pre&gt;&lt;span class="ValueType"&gt;void&lt;/span&gt; Foo (StringBuilder x)&lt;br /&gt;{&lt;br /&gt;    x = &lt;span class="Keyword"&gt;null&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;StringBuilder y = &lt;span class="Keyword"&gt;new&lt;/span&gt; StringBuilder();&lt;br /&gt;y.Append (&lt;span class="String"&gt;"hello"&lt;/span&gt;);&lt;br /&gt;Foo (y);&lt;br /&gt;Console.WriteLine (y==&lt;span class="Keyword"&gt;null&lt;/span&gt;);&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;Output: FalseInteresting right! Actually when we are passing object by reference, we are not passing the actual&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;reference to first object, instead we are just passing hte values.&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;The value of a reference type variable is the reference - if two reference type&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;variables refer to the same object, then changes to the data in that object will&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;be seen via both variables.&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-8889722762643610451?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.yoda.arachsys.com/csharp/parameters.html' title='Object are passed by reference'/><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/8889722762643610451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=8889722762643610451&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/8889722762643610451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/8889722762643610451'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2011/08/object-are-passed-by-reference.html' title='Object are passed by reference'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-2753513408168230067</id><published>2011-08-10T20:09:00.000+05:30</published><updated>2011-08-10T20:09:46.063+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>Reference types stored on Head and value types on Stack</title><content type='html'>We usually think that reference types are stored on the Head, right. Yes we are right.&lt;br /&gt;&lt;br /&gt;But we do think that value types are stored on Stack and here we are always not right.&lt;br /&gt;&lt;br /&gt;Only local variables are stored in the stack, so what's this local variables? Local variables declared within methods and method parameters live on stack. So when on heap? If they are declared within the class. Value types lives on wherever they are declared. So if they are created in reference type ex, class they would be stored on heap, and if declared locally ex. within method then stack.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-2753513408168230067?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/2753513408168230067/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=2753513408168230067&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/2753513408168230067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/2753513408168230067'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2011/08/reference-types-stored-on-head-and.html' title='Reference types stored on Head and value types on Stack'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-3343072088396716287</id><published>2011-08-10T19:45:00.000+05:30</published><updated>2011-08-10T19:45:55.430+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>Are Structs really lightweight classes?</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:TrackMoves/&gt;   &lt;w:TrackFormatting/&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:DoNotPromoteQF/&gt;   &lt;w:LidThemeOther&gt;EN-AU&lt;/w:LidThemeOther&gt;   &lt;w:LidThemeAsian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:LidThemeComplexScript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:SplitPgBreakAndParaMark/&gt;    &lt;w:DontVertAlignCellWithSp/&gt;    &lt;w:DontBreakConstrainedForcedTables/&gt;    &lt;w:DontVertAlignInTxbx/&gt;    &lt;w:Word11KerningPairs/&gt;    &lt;w:CachedColBalance/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathPr&gt;    &lt;m:mathFont m:val="Cambria Math"/&gt;    &lt;m:brkBin m:val="before"/&gt;    &lt;m:brkBinSub m:val="&amp;#45;-"/&gt;    &lt;m:smallFrac m:val="off"/&gt;    &lt;m:dispDef/&gt;    &lt;m:lMargin m:val="0"/&gt;    &lt;m:rMargin m:val="0"/&gt;    &lt;m:defJc m:val="centerGroup"/&gt;    &lt;m:wrapIndent m:val="1440"/&gt;    &lt;m:intLim m:val="subSup"/&gt;    &lt;m:naryLim m:val="undOvr"/&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"  DefSemiHidden="true" DefQFormat="false" DefPriority="99"  LatentStyleCount="267"&gt;   &lt;w:LsdException Locked="false" Priority="0" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Normal"/&gt;   &lt;w:LsdException Locked="false" Priority="9" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="heading 1"/&gt;   &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/&gt;   &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/&gt;   &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/&gt;   &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/&gt;   &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/&gt;   &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/&gt;   &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/&gt;   &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/&gt;   &lt;w:LsdException Locked="false" Priority="39" Name="toc 1"/&gt;   &lt;w:LsdException Locked="false" Priority="39" Name="toc 2"/&gt;   &lt;w:LsdException Locked="false" Priority="39" Name="toc 3"/&gt;   &lt;w:LsdException Locked="false" Priority="39" Name="toc 4"/&gt;   &lt;w:LsdException Locked="false" Priority="39" Name="toc 5"/&gt;   &lt;w:LsdException Locked="false" Priority="39" Name="toc 6"/&gt;   &lt;w:LsdException Locked="false" Priority="39" Name="toc 7"/&gt;   &lt;w:LsdException Locked="false" Priority="39" Name="toc 8"/&gt;   &lt;w:LsdException Locked="false" Priority="39" Name="toc 9"/&gt;   &lt;w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/&gt;   &lt;w:LsdException Locked="false" Priority="10" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Title"/&gt;   &lt;w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/&gt;   &lt;w:LsdException Locked="false" Priority="11" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/&gt;   &lt;w:LsdException Locked="false" Priority="22" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Strong"/&gt;   &lt;w:LsdException Locked="false" Priority="20" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/&gt;   &lt;w:LsdException Locked="false" Priority="59" SemiHidden="false"   UnhideWhenUsed="false" Name="Table Grid"/&gt;   &lt;w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/&gt;   &lt;w:LsdException Locked="false" Priority="1" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/&gt;   &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Shading"/&gt;   &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"   UnhideWhenUsed="false" Name="Light List"/&gt;   &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Grid"/&gt;   &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 1"/&gt;   &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 2"/&gt;   &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 1"/&gt;   &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 2"/&gt;   &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 1"/&gt;   &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 2"/&gt;   &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 3"/&gt;   &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"   UnhideWhenUsed="false" Name="Dark List"/&gt;   &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Shading"/&gt;   &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful List"/&gt;   &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Grid"/&gt;   &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Shading Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"   UnhideWhenUsed="false" Name="Light List Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Grid Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/&gt;   &lt;w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/&gt;   &lt;w:LsdException Locked="false" Priority="34" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/&gt;   &lt;w:LsdException Locked="false" Priority="29" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Quote"/&gt;   &lt;w:LsdException Locked="false" Priority="30" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/&gt;   &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"   UnhideWhenUsed="false" Name="Dark List Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful List Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/&gt;   &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Shading Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"   UnhideWhenUsed="false" Name="Light List Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Grid Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"   UnhideWhenUsed="false" Name="Dark List Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful List Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/&gt;   &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Shading Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"   UnhideWhenUsed="false" Name="Light List Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Grid Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"   UnhideWhenUsed="false" Name="Dark List Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful List Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/&gt;   &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Shading Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"   UnhideWhenUsed="false" Name="Light List Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Grid Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"   UnhideWhenUsed="false" Name="Dark List Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful List Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/&gt;   &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Shading Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"   UnhideWhenUsed="false" Name="Light List Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Grid Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"   UnhideWhenUsed="false" Name="Dark List Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful List Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/&gt;   &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Shading Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"   UnhideWhenUsed="false" Name="Light List Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"   UnhideWhenUsed="false" Name="Light Grid Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"   UnhideWhenUsed="false" Name="Dark List Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful List Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"   UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/&gt;   &lt;w:LsdException Locked="false" Priority="19" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/&gt;   &lt;w:LsdException Locked="false" Priority="21" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/&gt;   &lt;w:LsdException Locked="false" Priority="31" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/&gt;   &lt;w:LsdException Locked="false" Priority="32" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/&gt;   &lt;w:LsdException Locked="false" Priority="33" SemiHidden="false"   UnhideWhenUsed="false" QFormat="true" Name="Book Title"/&gt;   &lt;w:LsdException Locked="false" Priority="37" Name="Bibliography"/&gt;   &lt;w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt; /* Style Definitions */ table.MsoNormalTable	{mso-style-name:"Table Normal";	mso-tstyle-rowband-size:0;	mso-tstyle-colband-size:0;	mso-style-noshow:yes;	mso-style-priority:99;	mso-style-qformat:yes;	mso-style-parent:"";	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;	mso-para-margin-top:0cm;	mso-para-margin-right:0cm;	mso-para-margin-bottom:10.0pt;	mso-para-margin-left:0cm;	line-height:115%;	mso-pagination:widow-orphan;	font-size:11.0pt;	font-family:"Calibri","sans-serif";	mso-ascii-font-family:Calibri;	mso-ascii-theme-font:minor-latin;	mso-fareast-font-family:"Times New Roman";	mso-fareast-theme-font:minor-fareast;	mso-hansi-font-family:Calibri;	mso-hansi-theme-font:minor-latin;}&lt;/style&gt; &lt;![endif]--&gt;  We usually have very common myth about "Struts" that they are simple and should be used as data transfer types and they are lighter in terms of performance as they do not require garbage collection.&lt;br /&gt;&lt;br /&gt;But that is not fact in all cases.&lt;br /&gt;&lt;br /&gt;We should be careful while choosing between struct or reference type.&lt;br /&gt;&lt;br /&gt;It could more better to pass few bytes of data as reference rather than copying all the data, example passing Hashtable instance. Just imagine if Hashtable is values type, passing whole hashtable instead of the reference.&amp;nbsp; &lt;br /&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-3343072088396716287?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/3343072088396716287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=3343072088396716287&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/3343072088396716287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/3343072088396716287'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2011/08/are-structs-really-lightweight-classes.html' title='Are Structs really lightweight classes?'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-4321917862200171499</id><published>2011-07-23T08:14:00.001+05:30</published><updated>2011-07-28T19:43:03.080+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>C# Notes</title><content type='html'>&lt;b&gt;C# important notes&lt;/b&gt;:&lt;br /&gt;&lt;br /&gt;1.&amp;nbsp; &lt;u&gt;&lt;b&gt;Delegates &lt;/b&gt;&lt;/u&gt;provide a way of giving a level of indirection, so that instead of specifying behavior directly, it can be in some way "contained" in an object, which can be used like any other object, where one available option is to execute the encapsulated behavior.&lt;br /&gt;&lt;br /&gt;A &lt;b&gt;delegate type&lt;/b&gt; is a single-method interface , and a &lt;b&gt;delegate instance&lt;/b&gt; is an object implementing that interface.&lt;br /&gt;&lt;br /&gt;Delegates are typically used when the code that wants to execute the actions doesn't know the details of what the action should be.&lt;br /&gt;&lt;br /&gt;Four things need to happen: &lt;br /&gt;&lt;br /&gt;■ The delegate type needs to be declared.&lt;br /&gt;■ There must be a method containing the code to execute.&lt;br /&gt;■ A delegate instance must be created.&lt;br /&gt;■ The delegate instance must be invoked.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Delegate Type&lt;/b&gt; :&lt;br /&gt;A delegate type is effectively just a list of parameter types and a return type. It specifies what kind of action can be represented by instances of the type. For instance, consider a delegate type declared like this:&lt;br /&gt;&lt;br /&gt;delegate void StringProcessor (string input);&lt;br /&gt;&lt;br /&gt;The code says that if we want to create an instance of StringProcessor, we’re going to need a method with one parameter (a string) and a void return type (the method doesn’t return anything). It’s important to understand that StringProcessor really is a type. It has methods, you can create instances of it, pass around references to instances, the whole works. &lt;br /&gt;&lt;br /&gt;In .NET, &lt;b&gt;delegate instances &lt;/b&gt;always refer to methods.&lt;br /&gt;&lt;br /&gt;void PrintInteger (int x)&lt;br /&gt;&lt;br /&gt;An &lt;b&gt;instance of that delegate type&lt;/b&gt;, specifying that this method be executed when the delegate instance is invoked. Action of the delegate instance. &lt;br /&gt;&lt;br /&gt;StringProcessor proc1, proc2; &lt;br /&gt;proc1 = new StringProcessor(StaticMethods.PrintString);&lt;br /&gt;&lt;br /&gt;InstanceMethods instance = new InstanceMethods();&lt;br /&gt;proc2 = new StringProcessor(instance.PrintString);&lt;br /&gt;&lt;br /&gt;Example 1:&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;&lt;br /&gt;namespace Delegates_28July2011_7PM&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;//1. Declare delegate type&lt;/b&gt;.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; delegate void StringProcessor(string input);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; class Person&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; public string Name { get; private set; }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Person(string name)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name = name;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;b&gt; //2. Declare compatible INSTANCE method.&lt;/b&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void Say(string message)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine("{0} says: {1}", Name, message);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; class Background&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //2. Declare compatible STATIC method.&lt;/b&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void Not(String Note)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine("{0}", Note);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; class Program&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; static void Main(string[] args)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Person objPerson1 = new Person("Ram");&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Person objPerson2 = new Person("Shyam");&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;//3. Creates three delegate instance&lt;/b&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StringProcessor ramVoice, shyamVoice, background;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ramVoice = new StringProcessor(objPerson1.Say);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; shyamVoice = new StringProcessor(objPerson2.Say);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; background = new StringProcessor(Background.Not);&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //4. Invokes delegates instance&lt;/b&gt;.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ramVoice("Namaskar");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; shyamVoice("Skhaa");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; background("This is really sweet");&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.ReadLine();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-4321917862200171499?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/4321917862200171499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=4321917862200171499&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/4321917862200171499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/4321917862200171499'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2011/07/c-notes.html' title='C# Notes'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-6357395234900568766</id><published>2011-07-20T18:36:00.003+05:30</published><updated>2011-07-20T18:37:07.517+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Transaction Rollback</title><content type='html'>&lt;div class="MsoNormal"&gt;USE master;&lt;/div&gt;&lt;div class="MsoNormal"&gt;GO&lt;/div&gt;&lt;div class="MsoNormal"&gt;ALTER DATABASE AdventureWorks&lt;/div&gt;&lt;div class="MsoNormal"&gt;SET SINGLE_USER&lt;/div&gt;&lt;div class="MsoNormal"&gt;WITH ROLLBACK IMMEDIATE;&lt;/div&gt;&lt;div class="MsoNormal"&gt;ALTER DATABASE AdventureWorks&lt;/div&gt;&lt;div class="MsoNormal"&gt;SET MULTI_USER;&lt;/div&gt;&lt;div class="MsoNormal"&gt;GO &lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;Running above script will give following result.&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;Nonqualified transactions are being rolled back. Estimated rollback completion: 100%.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-6357395234900568766?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://blog.sqlauthority.com/2009/02/06/sql-server-quickest-way-to-kill-all-threads-kill-all-user-session-kill-all-processes/' title='Transaction Rollback'/><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/6357395234900568766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=6357395234900568766&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/6357395234900568766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/6357395234900568766'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2011/07/transaction-rollback.html' title='Transaction Rollback'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-501100086422733954</id><published>2011-01-20T15:45:00.000+05:30</published><updated>2011-01-20T15:45:36.106+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='HTML 5'/><title type='text'>HTML 5</title><content type='html'>HTML 5 is really sexy.... and I am dam sure that it's going to change the way we see the websites...&lt;br /&gt;&lt;br /&gt;Rough Timeline of Web Technologies&lt;br /&gt;&lt;br /&gt;1991 HTML&lt;br /&gt;1994 HTML 2&lt;br /&gt;1996 CSS 1 + JavaScript&lt;br /&gt;1997 HTML 4&lt;br /&gt;1998 CSS 2&lt;br /&gt;2000 XHTML 1&lt;br /&gt;2002 Tableless Web Design (remember we started using div instead of tables...)&lt;br /&gt;2005 AJAX (no postback..page flickering gone)&lt;br /&gt;&lt;br /&gt;and its HTML 5...I have started learning it and will continue to publish the things, I learn with HTML 5&lt;br /&gt;&lt;br /&gt;Interesting thing about HTML 5 is it's HTML5 = HTML + CSS + JS&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-501100086422733954?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/501100086422733954/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=501100086422733954&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/501100086422733954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/501100086422733954'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2011/01/html-5.html' title='HTML 5'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-5141340840610536172</id><published>2010-10-19T20:41:00.002+05:30</published><updated>2010-10-19T20:59:46.151+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>Best Practices for C# Application Development</title><content type='html'>&lt;b&gt;Decide between Value Types and Reference Types&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Whenever you need to create a type, first ask yourself a question “What you want and Why you want?”. If you could answer your question, you can decide between the type you want to use. If you want to store your data, use value types and when you want to create an instance of your type by defining the behavior, use reference types. Value types are not Polymorphic whereas, the Reference types can be. Value types are most efficient in terms of memory utilization over reference types and produces less help fragmentation &amp; garbage.  If you want to pass values to a method implementation, decide what you want to do and based upon your requirement, decide between value types and reference types. Use of reference type variables actually change the original value but use of value type will create a copy of the original variable and pass across the method. Thus, protects your original value from accidental changes. Lets see them in real example. In the below code, we are passing the variable “i” as value type and in the method implementation incrementing it by 10. As it was passed by value, you will see the original value “5” as output of the program code. &lt;br /&gt;&lt;br /&gt;&lt;i&gt;static void Main(string[] args)&lt;br /&gt;{&lt;br /&gt;int i = 5;&lt;br /&gt;SetValues(i);&lt;br /&gt;&lt;br /&gt;System.Console.WriteLine("Currently i = " + i); // will print "Currently i = 5"&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;static void SetValues(int x)&lt;br /&gt;{&lt;br /&gt;x += 10;&lt;br /&gt;}&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;In the below code as we are sending “i” as a reference, it will change the original value of “i” inside the method and hence you will see 15 as the output in the screen. &lt;br /&gt;&lt;br /&gt;&lt;i&gt;static void Main(string[] args)&lt;br /&gt;{&lt;br /&gt;int i = 5;&lt;br /&gt;SetValues(ref i);&lt;br /&gt;&lt;br /&gt;System.Console.WriteLine("Currently i = " + i); // will print "Currently i = 15"&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;static void SetValues(ref int x)&lt;br /&gt;{&lt;br /&gt;x += 10;&lt;br /&gt;}&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Prefer Runtime Constants over Compile time Constants&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Runtime constants are always preferred than the Compile time constants. Here you may ask what is runtime constant and what is compile time constant. Runtime constants are those which are evaluated at the runtime and declared with the keyword “readonly”. Other side, compile time constants are static, evaluated at the time of compilation and declared with the keyword “const”. &lt;br /&gt;&lt;br /&gt;&lt;i&gt;public readonly string CONFIG_FILE_NAME = "web.config"; // runtime constant&lt;br /&gt;public const string CONFIG_FILE_NAME = "web.config"; // compile time constant&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;So, what is the need to prefer readonly over const variables? Compile time constants (const) must be initialized at the time of declaration and can’t be change later. Also, they are limited to only numbers and strings. The IL replaces the const variable with the value of it over the whole code and thus it is a bit faster. Whereas, the Runtime constants (readonly) are initialized in the constructor and can be change at different initialization time. The IL references the readonly variable and not the original value. So, when you have some critical situation, use const to make the code run faster. When you need a reliable code, always prefer readonly variables. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Prefer “is” and “as” operators while casting&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;It is better to use “is” and “as” operator while casting. Instead of Explicit casting, use the Implicit casting. Let me describe you with the example of a code. &lt;br /&gt;&lt;br /&gt;&lt;i&gt;// this line may throw Exception if it is unable to downcast from Person to Employee&lt;br /&gt;var employee = (Employee) person;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;In the above code, suppose your person is a Customer type and when you are converting it to Employee type, it will throw Exception and it that case, you have to handle it using try{} catch{} block. Let’s convert the same using “is” and “as” operators. See the below code: &lt;br /&gt;&lt;br /&gt;&lt;i&gt;// check if the person is Employee type&lt;br /&gt;if(person is Employee)&lt;br /&gt;{&lt;br /&gt;// convert person to Employee type&lt;br /&gt;employee = person as Employee;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// check if the person is Customer type&lt;br /&gt;else if(person is Customer)&lt;br /&gt;{&lt;br /&gt;// convert person to Customer type&lt;br /&gt;customer = person as Customer;&lt;br /&gt;}&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;In the above code you can see that, in the second line I am checking whether the person is a Employee type. If it is of type Employee, it will go into the block. Else if it is a Customer type, will go to the block at line 12. Now, convert it with the “as” operator, as shown in the line 5. Here, if it is unable to convert, will return as null but will not throw any exception. So, in the next line you can check whether the converted value is null. Based on that, you can do what you want.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Always prefer the foreach(…) loop&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Rethrow exception and InnerException property in .NET&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In the example below, we have re-thrown exception with only a friendly message in the constructor method.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;private void DivideOperation()&lt;br /&gt;{&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;int x = 5;&lt;br /&gt;int y = 0;&lt;br /&gt;int result = x/y;&lt;br /&gt;}&lt;br /&gt;catch (Exception ex)&lt;br /&gt;{&lt;br /&gt;throw new DivideByZeroException(“Invalid operands were given.”);&lt;br /&gt;}&lt;br /&gt;}&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;This is, of course, not a good practice to do exception handling. So to preserve the details of the original exception, we have to pass the exception object as a second parameter in addition to friendly message as:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;private void DivideOperation()&lt;br /&gt;{&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;int x = 5;&lt;br /&gt;int y = 0;&lt;br /&gt;int result = x/y;&lt;br /&gt;}&lt;br /&gt;catch (Exception ex)&lt;br /&gt;{&lt;br /&gt;throw new DivideByZeroException(“Invalid operands were given.”, ex);&lt;br /&gt;}&lt;br /&gt;}&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-5141340840610536172?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.codeproject.com/KB/cs/CSharp_Coding_Practices.aspx' title='Best Practices for C# Application Development'/><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/5141340840610536172/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=5141340840610536172&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/5141340840610536172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/5141340840610536172'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2010/10/best-practices-for-c-application.html' title='Best Practices for C# Application Development'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-5434917274700761949</id><published>2010-09-24T20:53:00.000+05:30</published><updated>2010-09-24T20:53:17.810+05:30</updated><title type='text'>TSQL Search in text in stored procedure</title><content type='html'>SELECT Distinct SO.Name&lt;br /&gt;   FROM sysobjects SO (NOLOCK)&lt;br /&gt;   INNER JOIN syscomments SC (NOLOCK) on SO.Id = SC.ID&lt;br /&gt;   AND SO.Type = 'P'&lt;br /&gt;   AND SC.Text LIKE '%SuspendS21%'&lt;br /&gt;   ORDER BY SO.Name&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-5434917274700761949?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/5434917274700761949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=5434917274700761949&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/5434917274700761949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/5434917274700761949'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2010/09/tsql-search-in-text-in-stored-procedure.html' title='TSQL Search in text in stored procedure'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-8040580585824477903</id><published>2010-08-20T18:11:00.000+05:30</published><updated>2010-08-20T18:11:15.188+05:30</updated><title type='text'>XML based log file.</title><content type='html'>&lt;b&gt;XML file defines the structure:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;messagelog&amp;gt&lt;br /&gt;&amp;nbsp; &amp;lt;msgn&amp;gt&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;msg&amp;gt message &amp;lt;/msg&amp;gt&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;mdtls&amp;gt message details &amp;lt;/mdtls&amp;gt&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;mtype&amp;gt message type &amp;lt;/mtype&amp;gt&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sname&amp;gt Service Name&amp;lt;/sname&amp;gt&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;dt&amp;gt datetime &amp;lt;/dt&amp;gt&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/msgn&amp;gt &lt;br /&gt;&amp;nbsp;  &amp;lt;/messagelog&amp;gt&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Code file:&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Xml;&lt;br /&gt;&lt;br /&gt;namespace FXA_LogFile&lt;br /&gt;{&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;summary&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// This class is used to log the message across the application in XML file.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;/summary&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class LogHandler&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;summary&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// This is used to identify the message type in the xml file.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;/summary&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; enum MessageType&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Error=1,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Warning=2,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Inforamation=3&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;summary&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// This method is used to record the message of error type&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;/summary&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;br /&gt;&lt;param name="errorMessage" /&gt;Short error message&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;param name="errorDetails" /&gt;Error message description&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;param name="serviceName" /&gt;Name of service.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void LogErrorMessage(string errorMessage, string errorDetails, string serviceName)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WriteMessageToXMLFile(errorMessage, errorDetails, MessageType.Error, serviceName);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;summary&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// This method is used to record the message of warning type&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;/summary&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;param name="warningMessage" /&gt;Short warning message.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;param name="warningDetails" /&gt;Warning message description.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;param name="serviceName" /&gt;Name of service.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void LogWarningMessage(string warningMessage, string warningDetails, string serviceName)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WriteMessageToXMLFile(warningMessage, warningDetails, MessageType.Warning, serviceName);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;summary&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// This method is used to record the message of information type&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;/summary&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;param name="informationMessage" /&gt;Short information message.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;param name="informationDetails" /&gt;Information message description.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;param name="serviceName" /&gt;Name of service.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void LogInformationMessage(string informationMessage, string informationDetails, string serviceName)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WriteMessageToXMLFile(informationMessage, informationDetails, MessageType.Inforamation, serviceName);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;summary&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// This method append the message in the xml file.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;/summary&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;param name="message" /&gt;Short message.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;param name="messageDetails" /&gt;Message description.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;param name="varMessageType" /&gt;Type of message.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &lt;param name="serviceName" /&gt;Name of service.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private static void WriteMessageToXMLFile(string message, string messageDetails, MessageType varMessageType, string serviceName) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XmlDocument doc = new XmlDocument();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string xmlPath = @"FXA_Logfile.xml";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; doc.Load(@xmlPath);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XmlNode newXMLNode, oldXMLNode;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oldXMLNode = doc.ChildNodes[1].ChildNodes[0];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newXMLNode = oldXMLNode.CloneNode(true);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newXMLNode.ChildNodes[0].InnerText = DateTime.Now.ToString();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newXMLNode.ChildNodes[1].InnerText = message;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newXMLNode.ChildNodes[2].InnerText = messageDetails;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newXMLNode.ChildNodes[3].InnerText = varMessageType.ToString();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newXMLNode.ChildNodes[4].InnerText = serviceName;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; doc.ChildNodes[1].AppendChild(newXMLNode);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; doc.Save(@xmlPath);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; doc.RemoveAll();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="if(typeof(jsCall)=='function'){jsCall();}else{setTimeout('jsCall()',500);}" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-8040580585824477903?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/8040580585824477903/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=8040580585824477903&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/8040580585824477903'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/8040580585824477903'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2010/08/xml-based-log-file.html' title='XML based log file.'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-4983511344463230176</id><published>2010-03-04T11:39:00.001+05:30</published><updated>2010-03-04T19:14:20.438+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Best Practice SQL Server</title><content type='html'>Please understand the logical query processing of a query, so that you can write better queries:&lt;br /&gt;&lt;br /&gt;SELECT h.*,hp.HomePhotosID,hp.HasColorPhoto&lt;br /&gt;FROM Home h&lt;br /&gt;LEFT join HomePhotos hp&lt;br /&gt;ON h.HomeID = hp.HomeID&lt;br /&gt;AND h.Taxes = -555 &lt;br /&gt;&lt;br /&gt;logical query processing :&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: #783f04;"&gt;FROM (incl joins)&lt;/span&gt;&lt;br style="color: #783f04;" /&gt;&lt;span style="color: #783f04;"&gt;ON&lt;/span&gt;&lt;br style="color: #783f04;" /&gt;&lt;span style="color: #783f04;"&gt;OUTER&lt;/span&gt;&lt;br style="color: #783f04;" /&gt;&lt;span style="color: #783f04;"&gt;WHERE &lt;/span&gt;&lt;br style="color: #783f04;" /&gt;&lt;span style="color: #783f04;"&gt;GROUP BY&lt;/span&gt;&lt;br style="color: #783f04;" /&gt;&lt;span style="color: #783f04;"&gt;HAVING &lt;/span&gt;&lt;br style="color: #783f04;" /&gt;&lt;span style="color: #783f04;"&gt;SELECT&lt;/span&gt;&lt;br style="color: #783f04;" /&gt;&lt;span style="color: #783f04;"&gt;ORDER BY&lt;/span&gt;&lt;br style="color: #783f04;" /&gt;&lt;span style="color: #783f04;"&gt;TOP&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt; &lt;/b&gt;&lt;br /&gt;&lt;b&gt;CLR Integration&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The benefits of integrating the CLR with SQL Server include:&lt;br /&gt;&lt;br /&gt;1. The T-SQL statements that you execute actually run on the server end. But at times when you want to distribute the load between the client and server, you could go with the managed code. So using managed code you could perform critical logic operations in client side so that the server could be busy only with data intensive operations.&lt;br /&gt;&lt;br /&gt;2. The fact that SQL Server provides you extended stored procedures to avail certain system related functions from your T-SQL code, but at the same time you may have to compromise with the integrity of the server. When it comes to managed code, it provides type safety, effective memory management and better synchronization of services which is integrated tightly with the CLR and, hence, the SQL Server 2005. So this means that integrating CLR with SQL Server provides a scalable and safer means for accomplishing tasks which are tougher or almost impossible using T-SQL.&lt;br /&gt;&lt;br /&gt;3. .NET Framework provides a rich support for handling XML based operations from managed code; although realizing the fact the SQL Server supports XML based operations, you could perform such operations using .NET with little effort when compared to using T-SQL scripts.&lt;br /&gt;&lt;br /&gt;4. Nested transactions in T-SQL have limitations when dealing with look back connections, whereas this could be better achieved using managed code by setting the attribute "enlist=false" in the connection string.&lt;br /&gt;&lt;br /&gt;5. When working T-SQL you may not be able to fetch rows which form the middle of the operation from a result set until the execution gets finished. This is termed as pipelining of results which could be achieved with CLR integration.&lt;br /&gt;&lt;br /&gt;If you could check your database configuration you could notice that the CLR Integration is turned off by default. Enabling or disabling of CLR integration could be done by setting the "clr enabled" option to 1 or 0. Once the CLE integration is disabled, all the executing CLR procedures are unloaded across all application domains. To turn it on you need to use the following.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Use Row versioning-based isolation levels&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Row Level Versioning help in situations where an applications lot of insert and update operations on the data and at the same time a bunch of reports are accessing in parallel. It could also prove beneficial if your server is experiencing relatively high deadlocks. Also for systems performing mathematical computation, they require accurate precision and RLV gives a greater amount of accuracy for such kind of operations.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Error handling&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;use Try...Catch&lt;br /&gt;&lt;br /&gt;BEGIN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TRY&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BEGIN TRANSACTION &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; …..&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; --perform insert update and delete statements&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; …..&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; …..&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; COMMIT TRANSACTION &lt;br /&gt;END TRY&lt;br /&gt;BEGIN&lt;br /&gt;--Start&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CATCH&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ROLLBACK TRANSACTION &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINT ERROR_NUMBER()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINT ERROR_SEVERITY()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINT ERROR_STATE()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINT ERROR_PROCEDURE()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINT ERROR_LINE()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINT ERROR_MESSAGE()&lt;br /&gt;--End&lt;br /&gt;END CATCH&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Best Practices to handle Queries&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Stored procedures help improve the performance since they are precompiled. &lt;br /&gt;Avoid using like and notlike operatiors&lt;br /&gt;Avoid using function in where clause.&lt;br /&gt;Insead of CURSOR'S use temporary table with While.&lt;br /&gt;Select only those rows or columns that are needed in the result set&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Index &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Create indexes on columns which are used in WHERE condition and ORDER BY, GROUP BY and DISTINCT clauses.&lt;br /&gt;Indexes which are not used may cause extra overhead, so remove them if not in use.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Best practices in using Stored Procedures&lt;/b&gt;&lt;br /&gt;Do not use prefix in your stored procedures, i.e., do not prefix them with sp_. Microsoft ships system procedures which are prefixed with sp_. So if you prefix your procedures with sp_, SQL Server will first search in the master database for the procedure and then in your application database.&lt;br /&gt;If you do not want your client application to check the rows affected for an operation, then it is advisable to use SET NOCOUNT ON in your stored procedures. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-4983511344463230176?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/4983511344463230176/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=4983511344463230176&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/4983511344463230176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/4983511344463230176'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2010/03/best-practice-sql-server.html' title='Best Practice SQL Server'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-1289762805521367183</id><published>2010-01-25T12:03:00.000+05:30</published><updated>2010-01-25T12:03:14.447+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>INamingContainer Unique Name</title><content type='html'>&lt;div style="font-family: Verdana,sans-serif;"&gt;The Web page is a naming container for the controls that are added to it. A naming container defines a unique namespace for control names. Within a naming container, every control must be uniquely identifiable.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;How can multiple GridView controls be added to a Web page, and then, when their child controls are created, each has its own unique ID property? This is because the GridView control is a naming container.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;The naming container for a given child control is a control above it (parent or higher) in the hierarchy that implements the &lt;b&gt;INamingContainer interface&lt;/b&gt;. A server control implements this interface to create a unique namespace for populating the UniqueID property values of its child server controls. The UniqueID property contains the fully qualified name of the control. The difference between this property and the ID property is that the UniqueID property is generated automatically by the NamingContainer and contains the NamingContainer information.&lt;br /&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML" style="font-family: Verdana,sans-serif;"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-1289762805521367183?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/1289762805521367183/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=1289762805521367183&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/1289762805521367183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/1289762805521367183'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2010/01/inamingcontainer-unique-name.html' title='INamingContainer Unique Name'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-4406542632120188030</id><published>2010-01-25T10:19:00.001+05:30</published><updated>2010-01-25T10:27:03.791+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>What is Dynamic Web Site Compilation ?</title><content type='html'>&lt;div style="font-family: Verdana,sans-serif;"&gt;Dynamic Compilation refers to the delayed compilation of Web pages that takes place until the user requests the Web page.&lt;br /&gt;&lt;br /&gt;With dynamic compilation, the Web site doesn’t produce a deployable executable assembly as its output when it is built in Visual Studio 2005. Instead, each page is compiled when it is requested. The compiled page has a dependency on the source file’s timestamp. If the source code is changed, the page is recompiled the next time it is requested.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;In ASP.NET 2.0, because each Web page produces its own DLL, Visual Studio 2005 allows you to select a programming language for each Web page.&lt;/b&gt; &lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Benefits:&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;The entire application does not need to be recompiled every time a change is made to a single page or component, which is especially great news to developers of large Web sites. Remember that each page is recompiled as needed based on the timestamp of the source code files.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Pages that contain compile errors do not prevent other pages in the Web site from running. This means that you can test Web sites that contain pages still in development.&lt;br /&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;&lt;div id="refHTML" style="font-family: Verdana,sans-serif;"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-4406542632120188030?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/4406542632120188030/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=4406542632120188030&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/4406542632120188030'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/4406542632120188030'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2010/01/what-is-dynamic-web-site-compilation.html' title='What is Dynamic Web Site Compilation ?'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-5091707455181444697</id><published>2010-01-25T10:17:00.001+05:30</published><updated>2010-01-25T10:18:02.099+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>ASP.NET Page Structure</title><content type='html'>&lt;div style="font-family: Verdana,sans-serif;"&gt;The typical Web page is composed of three sections: page directives, code, and page layout.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style="font-family: Verdana,sans-serif;"&gt;&lt;li&gt;&lt;b&gt;Page Directives&lt;/b&gt; This section is used to set up the environment, specifying how the page should be processed. For example, this is where you can import namespaces and load assemblies.&lt;/li&gt;&lt;/ul&gt;&lt;ul style="font-family: Verdana,sans-serif;"&gt;&lt;li&gt;&lt;b&gt;Code &lt;/b&gt;This section contains code to handle events from the page or its controls. Code can be placed in a &lt;script&gt; tag. By default, script blocks contain client-side code but they may be designated as being server-side code by including the runat="server" attribute in the &lt;script&gt; tag. As a side note, code can also be contained in attached files, called code-behind files. All page code is compiled prior to execution. In addition, all pages can be precompiled to an assembly if the assembly is the only file that needs to be deployed.&lt;/li&gt;&lt;/ul&gt;&lt;ul style="font-family: Verdana,sans-serif;"&gt;&lt;li&gt;&lt;b&gt;Page Layout&lt;/b&gt; The page layout is the HTML of the page, which includes the HTML body and its markup. The body can contain client and server controls as well as simple text.&lt;/li&gt;&lt;/ul&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div style="font-family: Verdana,sans-serif;" id="refHTML"&gt;&lt;/div&gt;&lt;/script&gt;&lt;/li&gt;&lt;/ul&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-5091707455181444697?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/5091707455181444697/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=5091707455181444697&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/5091707455181444697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/5091707455181444697'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2010/01/aspnet-page-structure.html' title='ASP.NET Page Structure'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-7388117492395233619</id><published>2010-01-25T10:09:00.001+05:30</published><updated>2010-01-25T10:11:42.154+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>solution file (.sln) and a hidden solution user options file (.suo)</title><content type='html'>&lt;div style="font-family: Verdana,sans-serif;"&gt;The solution file is a text file that contains information such as the following:&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;■ A list of the projects that are to be loaded into Visual Studio 2005&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;■ A list of project dependencies&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;■ Microsoft Visual SourceSafe information&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;■ A list of add-ins that are available&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;The solution user options file is a binary file that contains various user settings related to the Integrated Development Environment (IDE), such as the following:&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;■ The task list&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;■ Debugger break points and watch window settings&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;■ Visual Studio window locations&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="refHTML" style="font-family: Verdana,sans-serif;"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML" style="font-family: Verdana,sans-serif;"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-7388117492395233619?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/7388117492395233619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=7388117492395233619&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/7388117492395233619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/7388117492395233619'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2010/01/solution-file-sln-and-hidden-solution.html' title='solution file (.sln) and a hidden solution user options file (.suo)'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-7100652560214949128</id><published>2010-01-21T15:23:00.001+05:30</published><updated>2011-07-20T18:18:15.435+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C# 3.5 new feature'/><title type='text'>Partial Classes</title><content type='html'>&lt;div style="font-family: Verdana,sans-serif;"&gt;allow a class to be split over multiple source files and have no effect on the intermediate code produced by the compiler.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;The following are other points to keep in mind:&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;• Structs can use the partial modifier, but enumerations can’t.&lt;br /&gt;&lt;br /&gt;• Assemblies form the boundaries of classes, and a partial class can’t span multiple assemblies.&lt;br /&gt;&lt;br /&gt;• If one file marks a class as partial, all other declarations of the class must also use thepartial modifier.&lt;br /&gt;&lt;br /&gt;• It’s legal for each partial class to add features to the class as long as they aren’t mutually exclusive.&lt;br /&gt;&lt;br /&gt;C# 1:&lt;br /&gt;Read only properties.&lt;br /&gt;Weakly typed collections&lt;br /&gt;&lt;br /&gt;C#2 :&lt;br /&gt;Private property "setters".&lt;br /&gt;Strongly typed collections&lt;br /&gt;&lt;br /&gt;c# 3:&lt;br /&gt;Automatically implemented properties&lt;br /&gt;Enhanced collection and object intialization.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;&lt;div id="refHTML" style="font-family: Verdana,sans-serif;"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-7100652560214949128?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/7100652560214949128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=7100652560214949128&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/7100652560214949128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/7100652560214949128'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2010/01/partial-classes.html' title='Partial Classes'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-5513918713779036322</id><published>2010-01-21T12:26:00.000+05:30</published><updated>2010-01-21T12:26:44.750+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Difference'/><title type='text'>Constants and ReadOnly</title><content type='html'>&lt;div style="font-family: Verdana,sans-serif;"&gt;Because of the restriction on constant types being knowable at compile time, const can’t be&lt;br /&gt;used in many situations.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;The readonly modifier is designed for exactly that situation. By applying readonly, you can&lt;br /&gt;set the value in the constructor or in an initializer, but you can’t modify it later.&lt;br /&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML" style="font-family: Verdana,sans-serif;"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-5513918713779036322?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/5513918713779036322/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=5513918713779036322&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/5513918713779036322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/5513918713779036322'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2010/01/constants-and-readonly.html' title='Constants and ReadOnly'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-2965644301028020964</id><published>2010-01-21T11:05:00.000+05:30</published><updated>2010-01-21T11:05:08.214+05:30</updated><title type='text'>ref and out</title><content type='html'>&lt;div style="font-family: Verdana,sans-serif;"&gt;They are usually used, when we needs to return more than one value from function.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Out parameters are like ref parameters except that an uninitialized variable can be passed to them and the call is made with out rather than ref&lt;br /&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML" style="font-family: Verdana,sans-serif;"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-2965644301028020964?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/2965644301028020964/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=2965644301028020964&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/2965644301028020964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/2965644301028020964'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2010/01/ref-and-out.html' title='ref and out'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-3940210030018691045</id><published>2010-01-21T10:51:00.002+05:30</published><updated>2010-01-21T15:35:27.738+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='One Line Defination'/><title type='text'>Assembly One line defination</title><content type='html'>&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;Metadata&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;• The name of the object&lt;br /&gt;• The names of all the fields of the object and their types&lt;br /&gt;• The names of all member functions, including parameter types and names&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Runtime code can query the metadata—in a process called &lt;i&gt;reflection&lt;/i&gt;—to find out what objects are available and what functions and fields are present on the class.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;Manifest&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Each assembly contains a manifest that enumerates the files contained in the assembly, controls what types and resources are exposed outside the assembly, and maps references from those types and resources to the files that contain the types and resources. The manifest also lists the other assemblies that an assembly depends upon.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;b&gt;Assemblies &lt;/b&gt;are self-contained; enough information exists in the assembly for it to be self-describing.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;When defining an assembly, the assembly can be contained in a single file, or it can be split amongst several files. Using several files will enable a scenario where sections of the assembly are downloaded only as needed.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;mscorlib.dll&lt;/b&gt; - which contains the core functions for the CLR&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;Enums - &lt;/b&gt;Enumerators declare a set of related constants—such as the colors that a control can take in a clear and type-safe manner.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;Delegates &lt;/b&gt;are a type-safe, object-oriented implementation of function pointers and are used in many situations where a component needs to call back to the component that’s using it. They’re used most heavily as the basis for events, which allow a delegate to easily be registered for an event.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;ILDASM&lt;/b&gt; can open an assembly, show all the types in the assembly, show what methods are defined for those types, and show the IL that was generated for that method.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;checked/unchecked&lt;/b&gt;&amp;nbsp; The checked and unchecked statements control whether exceptions are thrown if conversions or expressions overflow.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;as&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The as operator is similar to the is operator, but instead of just determining whether an object is a specific type or interface, it also performs the explicit conversion to that type. If the object can’t be converted to that type, the operator returns null. Using as is more efficient than the is operator, since the as operator needs to check the type of the object only once &lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;&lt;div id="refHTML" style="font-family: Verdana,sans-serif;"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-3940210030018691045?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/3940210030018691045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=3940210030018691045&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/3940210030018691045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/3940210030018691045'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2010/01/assembly-one-line-defination.html' title='Assembly One line defination'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-7484287896108840966</id><published>2010-01-21T10:10:00.006+05:30</published><updated>2010-02-04T15:28:38.953+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='OOPS'/><title type='text'>OOPS</title><content type='html'>&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;Object&lt;/b&gt;:&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;An object is merely a collection of related information and functionality.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;Inheritance&lt;/b&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;First, inheritance is an example of what’s known in object-oriented design as an “is-a” relationship.&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Composition&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;b&gt; &lt;/b&gt;&lt;br /&gt;Composition gives us a 'part-of' relationship.&lt;br /&gt;Within composition, the lifetime of the part (Engine) is managed by the whole (Car), in other words, when Car is destroyed, Engine is destroyed along with it. &lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_6XHbAwNwjTo/S2qZ_BLe_yI/AAAAAAAAAvk/2_1USQA1tcs/s1600-h/composition.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_6XHbAwNwjTo/S2qZ_BLe_yI/AAAAAAAAAvk/2_1USQA1tcs/s320/composition.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;Aggregation&lt;/b&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Aggregation gives us a 'has-a' relationship. Within aggregation, the lifetime of the part is not managed by the whole.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_6XHbAwNwjTo/S2qaHdk8uxI/AAAAAAAAAvs/Jjm9tLeu_Hg/s1600-h/Aggregation.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_6XHbAwNwjTo/S2qaHdk8uxI/AAAAAAAAAvs/Jjm9tLeu_Hg/s320/Aggregation.bmp" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;Polymorphism&lt;/b&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;An &lt;i&gt;abstract class&lt;/i&gt;, which is a class that defines the functions a derived class must implement and that sometimes provides functions that are useful to both classes. &lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Abstract functions are automatically virtual functions, which allow the programmer to use polymorphism to make their code simpler. When there’s a virtual function, the programmer can pass around a reference to the abstract class rather than the derived class, and the compiler will write code to call the appropriate version of the function at runtime.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif; text-align: left;"&gt;Polymorphism and virtual functions are used in many places in the .NET runtime system. For example, the base object object has a virtual function called ToString() that’s used to convert an object into a string representation of the object. If you call the ToString() function on an object that doesn’t have its own version of ToString(), the version of the ToString() function that’s part of the object class will be called, which simply returns the name of the&lt;br /&gt;class. If you overload—write your own version of—the ToString() function, that one will be called instead, and you can do something more meaningful, such as writing out the name of the employee contained in the employee object. &lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif; text-align: left;"&gt;&lt;b&gt;Encapsulation&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Overloading&lt;/b&gt;&lt;br /&gt;&lt;b&gt; &lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Sometimes it may be useful to have two functions that do the same thing but take different parameters. This is especially common for constructors, when there may be several ways to create a new instance.&lt;b&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Virtual&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Virtual means that when a call to a member function is made, the compiler should look at the real type of the object (not just the type of the reference) and call the appropriate function based on that type.&lt;b&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Sealed &lt;/b&gt;classes prevent a class from being used as a base class. They’re primarily useful to prevent unintended derivation.A sealed method lets a class override a virtual function and prevents a derived class from&lt;br /&gt;overriding that same function.&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;Static Constructor&lt;/b&gt; will be called before the first instance of an object is created. It’s useful to do setup work that needs to be done only once.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;&lt;div id="refHTML" style="font-family: Verdana,sans-serif;"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-7484287896108840966?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/7484287896108840966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=7484287896108840966&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/7484287896108840966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/7484287896108840966'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2010/01/oops.html' title='OOPS'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_6XHbAwNwjTo/S2qZ_BLe_yI/AAAAAAAAAvk/2_1USQA1tcs/s72-c/composition.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-2042938401320109546</id><published>2010-01-20T12:31:00.002+05:30</published><updated>2010-01-21T11:02:13.037+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net exception'/><title type='text'>exception handling in .net</title><content type='html'>&lt;div style="font-family: Verdana,sans-serif;"&gt;If the method does not do what it is supposed to do,  it should throw an exception to notify it&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;Exception handling versus returning error codes&lt;/b&gt; &lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style="font-family: Verdana,sans-serif;"&gt;&lt;li&gt;When using error code, we must usually find a way to also return whatever  the method is supposed to return. That either makes us change the signature and  use (out) parameters or (worse) embed the error code and the returned type into  another class/structure.&amp;nbsp; &lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;/li&gt;&lt;li&gt;Another reason, and probably most important one, is that whenever we call a  method that returns an error code, we must test it otherwise, we may let the  code execute in an unstable state and eventually, propagate the error to upper  layers of the application. On the other hand, if we throw an exception, it  should be either explicitly caught or the application will simply terminate.  This makes the code more robust since even if we forget to catch an exception,  we will notice it while testing which is not the case if we use error codes and  forget to check returned codes.  &lt;/li&gt;&lt;li&gt;An exception contains much more information than an error code. It contains  the exact location of the encountered issue and it should contain, in the  message, the exact reason of failure and, for well designed exceptions, how to  fix the problem. We no longer need to document each error code and manage error  codes duplications. The exception contains all the information developers need  to know.  &lt;/li&gt;&lt;li&gt;If we want an error to propagate to upper callers in the stack, we just let  the exception unhandled&amp;nbsp;and it will&amp;nbsp;be propagated to&amp;nbsp;upper layers.&amp;nbsp;Whereas using  codes, we must test for the code, return it and do this for all the callers of  the method at all levels.  &lt;/li&gt;&lt;li&gt;Exceptions can be instrumented and monitored using standard applications in  Windows.  &lt;/li&gt;&lt;li&gt;When debugging, we can set the debugger to start when a certain type of  exception is thrown.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;There are many “generic” exception types that can be used in different  scenarios:&lt;br /&gt;&lt;/div&gt;&lt;ul style="font-family: Verdana,sans-serif;"&gt;&lt;li&gt;ArgumentInvalidException, ArgumentNullException and  ArgumentOutOfRangeException  &lt;/li&gt;&lt;li&gt;InvalidOperationException &lt;/li&gt;&lt;/ul&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;If we consider these exceptions, we figure out that they may cover many cases  of invalid arguments or, for the latest, an operation that we attempt to execute  on an object in an invalid state for instance.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;There are other exceptions that we should avoid using such as those thrown by  the CLR (OutOfMemoryException, StackOverflowException and alike). Only the CLR  should be able to throw these types.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;Tester-Doer Pattern&lt;/b&gt; &lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;Try-Parse Pattern&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;The Try Parse pattern consists in exposing a method and an exception safe  version of the same method so that other programmers will be able to call it  without paying attention to the exception. In .NET framework such pattern is  used for the&lt;span style="color: blue;"&gt; DateTime.Parse &lt;/span&gt;method. In fact,  there is another version of this method called &lt;span style="color: blue;"&gt;DateTime.TryParse&lt;/span&gt; which returns a boolean  indicating whether the method succeeded or not and an OUT parameter that  contains the resulting DateTime object in case it is successfull.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;We should always avoid a Try-Catch-Finalize block with an empty Catch section.  This will only hide potential issues. However, having a catch section that just  rethrows the same exception can only be useful if the finalize section does  something otherwise, we better remove the try-catch block at all.&amp;nbsp; &lt;br /&gt;&lt;/div&gt;&lt;h3 style="font-family: Verdana,sans-serif;"&gt;Rethrowing and wrapping&lt;/h3&gt;&lt;ul style="font-family: Verdana,sans-serif;"&gt;&lt;li&gt;When rethrowing the same exception, we better use ‘throw’ (without  arguments) otherwise, we will&amp;nbsp;loose stack information.  &lt;/li&gt;&lt;li&gt;When wrapping an exception, it might be a good idea to include the original  exception as the inner exception (to keep some information about the original  context).  &lt;/li&gt;&lt;li&gt;Consider wrapping exceptions to give more details about the context. For  instance, a caching component (that does file caching) may have a &lt;span style="color: #3366ff;"&gt;FileNotFoundException&lt;/span&gt; thrown when it tries to  access a cache file. However, for its users, that might not have enough  information to understand the exception. In this case, we should wrap it in a  CacheFileNotFoundException (custom type) that contains information on the query  we have done to the caching component for instance.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;i&gt;When it finds a try block, it then looks for associated catch blocks. If it finds catch blocks, it picks the best one&amp;nbsp; and executes the code within the catch block.&lt;/i&gt;&amp;nbsp;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;When an exception occurs, the proper catch block is determined by matching the type of the exception to the name of the exception mentioned. catch blocks always must be listed from most specific to least specific.&lt;br /&gt;&lt;/div&gt;&lt;ul style="font-family: Verdana,sans-serif;"&gt;&lt;/ul&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&amp;nbsp;Reference : &lt;a href="http://bellouti.wordpress.com/2009/08/28/guidelines-for-consistent-exception-and-error-handling/"&gt;click here&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="refHTML" style="font-family: Verdana,sans-serif;"&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="refHTML" style="font-family: Verdana,sans-serif;"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML" style="font-family: Verdana,sans-serif;"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-2042938401320109546?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://bellouti.wordpress.com/2009/08/28/guidelines-for-consistent-exception-and-error-handling/' title='exception handling in .net'/><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/2042938401320109546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=2042938401320109546&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/2042938401320109546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/2042938401320109546'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2010/01/exception-handling-in-net.html' title='exception handling in .net'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-6608860485291534595</id><published>2010-01-20T09:35:00.000+05:30</published><updated>2010-01-20T09:35:52.656+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unit testing'/><title type='text'>NUnit</title><content type='html'>&lt;b&gt;Unit testing&lt;/b&gt; is validation and verification methodology where the developers  test the individual units of source code.&lt;br /&gt;&lt;br /&gt;1. Add reference dll " C:\Program Files\NUnit 2.5.2\bin\net-2.0\framework\nunit.framework.dll ".&lt;br /&gt;2. include namespace &lt;span style="font-family: Courier New; font-size: x-small;"&gt;using NUnit.Framework; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;TestFixture&lt;/b&gt;: This is an attribute used to define on test class.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Test&lt;/b&gt;: This is attribute for method, used to define in the test class, this method actually contains the test logic.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Assert&lt;/b&gt;: This is an command, used to check if the expected output and the results return match&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_6XHbAwNwjTo/S1aA-5myIqI/AAAAAAAAAvA/WE14LUUgX1A/s1600-h/SampleNUnit.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_6XHbAwNwjTo/S1aA-5myIqI/AAAAAAAAAvA/WE14LUUgX1A/s320/SampleNUnit.bmp" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-6608860485291534595?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.dotnetfunda.com/articles/article707-5-simple-steps-to-execute-unit-testing-using-nunit.aspx' title='NUnit'/><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/6608860485291534595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=6608860485291534595&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/6608860485291534595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/6608860485291534595'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2010/01/nunit.html' title='NUnit'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_6XHbAwNwjTo/S1aA-5myIqI/AAAAAAAAAvA/WE14LUUgX1A/s72-c/SampleNUnit.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-559306245713914248</id><published>2010-01-20T08:34:00.001+05:30</published><updated>2010-01-21T12:21:39.378+05:30</updated><title type='text'>.net application memory leak</title><content type='html'>&lt;div style="font-family: Verdana,sans-serif;"&gt;Memory leaks grow slowly and after sometime they bring down the server by  consuming huge chunks of memory. Maximum time people reboot the system, make it  work temporarily but after some time again your server is down. &lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;Task Manager - Can this detect memory leak &lt;/b&gt;?&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Task manager shows working set memory and not the actual memory used, ok so what  does that mean. This memory is the allocated memory and not the used memory.  Adding further some memory from the working set can be shared by other processes  / application.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=3120602423723919508&amp;amp;postID=559306245713914248" name="Usingprivatebytesperformancecounterstodetectmemoryleak"&gt;Using private  bytes performance counters to detect memory leak&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Private bytes are those memory areas which are not shared by other application.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Below are the steps we need to follow to track private bytes in an  application using performance counters:-&lt;br /&gt;&lt;/div&gt;&lt;ul style="font-family: Verdana,sans-serif;"&gt;&lt;li&gt;Start you application which has memory leak and keep it running.&lt;/li&gt;&lt;li&gt;Click start à Goto run and type ‘perfmon’.&lt;/li&gt;&lt;li&gt;Delete all the current performance counters by selecting the counter and  deleting the same by hitting the delete button.&lt;/li&gt;&lt;li&gt;Right click à select ‘Add counters’ à select ‘process’ from performance  object.&lt;/li&gt;&lt;li&gt;From the counter list select ‘Private bytes’.&lt;/li&gt;&lt;li&gt;From the instance list select the application which you want to test memory  leak for.&lt;/li&gt;&lt;/ul&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;If you application shows a steady increase in private bytes value that means we  have a memory leak issue here.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=3120602423723919508&amp;amp;postID=559306245713914248" name="3stepprocesstoinvestigatememoryleak"&gt;3 step process to investigate memory  leak&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style="font-family: Verdana,sans-serif;"&gt;&lt;li&gt;What: - We will first try to investigate what is the type of memory leak, is  it a managed memory leak or an unmanaged memory leak.&lt;/li&gt;&lt;li&gt;How: - What is really causing the memory leak. Is it the connection object,  some kind of file who handle is not closed etc?&lt;/li&gt;&lt;li&gt;Where: - Which function / routine or logic is causing the memory leak.&lt;/li&gt;&lt;/ul&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;.NET application have two types of memory managed memory and unmanaged memory.  Managed memory is controlled by garbage collection while unmanaged memory is  outside of garbage collectors boundary.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;Private bytes are the total memory consumed by the application. Bytes in all  heaps are the memory consumed by the managed code. &lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;Un Managed memory + Bytes in all helps = private bytes&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style="font-family: Verdana,sans-serif;"&gt;&lt;li&gt;If the private bytes increase and bytes in all heaps remain constant that  means it’s an unmanaged memory leak.&lt;/li&gt;&lt;li&gt;If the bytes in all heaps increase linearly that means it’s a managed memory  leak.&lt;/li&gt;&lt;/ul&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;Finalizers &lt;/b&gt;are responsible only for their own resources, while &lt;b&gt;Dispose&lt;/b&gt;() also deals with referenced resources.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;GC.SuppressFinalize&lt;/b&gt;() so that the garbage collector won’t bother to finalize this object.&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&amp;nbsp; &lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id="refHTML" style="font-family: Verdana,sans-serif;"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML" style="font-family: Verdana,sans-serif;"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-559306245713914248?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.dotnetfunda.com/articles/article625-best-practices-no-5--detecting-net-application-memory-leaks.aspx' title='.net application memory leak'/><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/559306245713914248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=559306245713914248&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/559306245713914248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/559306245713914248'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2010/01/net-application-memory-leak.html' title='.net application memory leak'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-7983369463746774661</id><published>2010-01-19T14:30:00.002+05:30</published><updated>2010-01-19T14:30:49.735+05:30</updated><title type='text'>AJAX application optimization tool</title><content type='html'>&lt;a href="http://msdn.microsoft.com/en-us/devlabs/ee423534.aspx"&gt;Doloto- click to know more&lt;/a&gt;&lt;br /&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-7983369463746774661?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/7983369463746774661/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=7983369463746774661&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/7983369463746774661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/7983369463746774661'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2010/01/ajax-application-optimization-tool.html' title='AJAX application optimization tool'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-22767247593250064</id><published>2010-01-19T12:23:00.000+05:30</published><updated>2010-01-19T12:23:38.384+05:30</updated><title type='text'>Disable Back Button</title><content type='html'>Force  the previous page to expire. This solution isn't about disabling the Back button  but selecting pages that you don't want the user to return to. When you force a  page to expire then, when the user hits the Back button and returns to the page,  the browser is forced to go back to the server to retrieve the page -- this  gives your server-side code a chance to run.&lt;br /&gt;&lt;br /&gt;This directive, added to a page in Source view, will do the job on most  browsers:&lt;br /&gt;&lt;br /&gt;&lt;pre class="codesnippet"&gt;‹%@ OutputCache location="none" Duration="1" VaryByParam="none" %›&lt;/pre&gt;&lt;pre class="codesnippet"&gt;&lt;/pre&gt;You also do it from code by calling the SetCacheability method:&lt;br /&gt;&lt;br /&gt;&lt;pre class="codesnippet"&gt;Reponse.Cache.SetCacheability(HttpCacheability.NoCache)&lt;/pre&gt;&lt;pre class="codesnippet"&gt;&lt;/pre&gt;&lt;pre class="codesnippet"&gt;&lt;a href="http://www.boutell.com/newfaq/creating/backbutton.html"&gt;for more read this&lt;/a&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-22767247593250064?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/22767247593250064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=22767247593250064&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/22767247593250064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/22767247593250064'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2010/01/disable-back-button.html' title='Disable Back Button'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-2468637213638981230</id><published>2010-01-19T11:29:00.004+05:30</published><updated>2010-01-19T11:44:53.776+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET Paths'/><title type='text'>Request Object Paths</title><content type='html'>Here's a list of the Path related properties on the Request object (and the Page  object). Assume a path like  &lt;i&gt;http://www.west-wind.com/webstore/admin/paths.aspx&lt;/i&gt; for the paths below  where webstore is the name of the virtual.&lt;br /&gt;&lt;br /&gt;&lt;table border="0" cellpadding="5" cellspacing="0" class="blackborder" height="1712" style="width: 397px;"&gt;&lt;tbody&gt;&lt;tr class="gridheader"&gt; &lt;td align="middle" valign="top" width="261"&gt;&lt;b&gt;Request Property&lt;/b&gt;&lt;br /&gt;&lt;/td&gt; &lt;td align="middle" valign="top" width="515"&gt;&lt;b&gt;Description and  Value&lt;/b&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="261"&gt;ApplicationPath&lt;br /&gt;&lt;/td&gt; &lt;td valign="top" width="515"&gt;Returns the web root-relative logical path to the  &lt;i&gt;virtual root&lt;/i&gt; of this app.&lt;br /&gt;&lt;b&gt;/webstore/&lt;/b&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="261"&gt;PhysicalApplicationPath&lt;br /&gt;&lt;/td&gt; &lt;td valign="top" width="515"&gt;Returns &lt;i&gt;local file system path&lt;/i&gt; of the  &lt;i&gt;virtual root&lt;/i&gt; for this app. &lt;br /&gt;&lt;b&gt;c:\inetpub\wwwroot\webstore&lt;/b&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="261"&gt;PhysicalPath&lt;br /&gt;&lt;/td&gt; &lt;td valign="top" width="515"&gt;Returns the &lt;i&gt;local file system path&lt;/i&gt; to the  &lt;i&gt;current script or path&lt;/i&gt;. &lt;br /&gt;&lt;b&gt;c:\inetpub\wwwroot\webstore\admin\paths.aspx&lt;/b&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="261"&gt;Path&lt;br /&gt;FilePath&lt;br /&gt;CurrentExecutionFilePath &lt;br /&gt;&lt;/td&gt; &lt;td valign="top" width="515"&gt;All of these return the full &lt;i&gt;root relative logical  path&lt;/i&gt; to the script page including path and scriptname.  CurrentExcecutionFilePath will return the ‘current’ request path after a  Transfer/Execute call while FilePath will always return the original request’s  path.&lt;br /&gt;&lt;b&gt;/webstore/admin/paths.aspx&lt;/b&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="261"&gt;AppRelativeCurrentExecutionFilePath&lt;br /&gt;&lt;/td&gt; &lt;td valign="top" width="515"&gt;Returns an ASP.NET &lt;i&gt;root relative virtual path&lt;/i&gt;  to the script or path for the current request. If in  a Transfer/Execute call  the transferred Path is returned. &lt;br /&gt;&lt;b&gt;~/admin/paths.aspx&lt;/b&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="261"&gt;PathInfo&lt;br /&gt;&lt;/td&gt; &lt;td valign="top" width="515"&gt;Returns any extra path following the script name. If no  extra path is provided returns the root-relative path &lt;span style="font-family: ver; font-size: 78%;"&gt;(returns text in red below)&lt;/span&gt;. string.Empty if no PathInfo is  available.&lt;br /&gt;&lt;b&gt;/webstore/admin/paths.aspx&lt;span style="color: maroon;"&gt;/ExtraPathInfo &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="261"&gt;RawUrl&lt;br /&gt;&lt;/td&gt; &lt;td valign="top" width="515"&gt;Returns the full root &lt;i&gt;relative relative URL&lt;/i&gt;  including querystring and extra path as a string. &lt;br /&gt;&lt;b&gt;/webstore/admin/paths.aspx?sku=wwhelp40&lt;/b&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="261"&gt;Url&lt;br /&gt;&lt;/td&gt; &lt;td valign="top" width="515"&gt;Returns a &lt;i&gt;fully qualified URL&lt;/i&gt; including  querystring and extra path. Note this is a &lt;i&gt;Uri &lt;/i&gt;instance rather than  string. &lt;br /&gt;&lt;b&gt;http://www.west-wind.com/webstore/admin/paths.aspx?sku=wwhelp40&lt;/b&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="261"&gt;UrlReferrer&lt;br /&gt;&lt;/td&gt; &lt;td valign="top" width="515"&gt;The &lt;i&gt;fully qualified URL&lt;/i&gt; of the &lt;i&gt;page that  sent the request&lt;/i&gt;. This is also a &lt;i&gt;Uri&lt;/i&gt; instance and this value is  null if the page was directly accessed by typing into the address bar or using  an HttpClient. Based Referrer client Http header. &lt;br /&gt;&lt;b&gt;http://www.west-wind.com/webstore/default.aspx?Info&lt;/b&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt; &lt;td valign="top" width="261"&gt;&lt;i&gt;Control&lt;/i&gt;.&lt;br /&gt;TemplateSourceDirectory&lt;br /&gt;&lt;/td&gt; &lt;td valign="top" width="515"&gt;Returns the &lt;i&gt;logical path to the folder&lt;/i&gt; of the  page, master or user control on which it is called. This is useful if you need  to know the&lt;i&gt; path only &lt;/i&gt;to a Page or control from within the control. For  non-file controls this returns the Page path. &lt;br /&gt;&lt;b&gt;/webstore/admin/&lt;/b&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For more details click on blog title...&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;br /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden" /&gt;&lt;!--Session data--&gt;&lt;input id="jsProxy" onclick="jsCall();" type="hidden" /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-2468637213638981230?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.west-wind.com/Weblog/posts/132081.aspx' title='Request Object Paths'/><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/2468637213638981230/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=2468637213638981230&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/2468637213638981230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/2468637213638981230'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2010/01/request-object-paths.html' title='Request Object Paths'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-6437192874338444395</id><published>2010-01-19T10:24:00.003+05:30</published><updated>2010-01-19T10:37:42.144+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Routing'/><title type='text'>Routing - .net</title><content type='html'>&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Routing &lt;/span&gt;is a technique which enables us to use a descriptive, search engine and human friendly URL’s for ASP.Net application to access a resource.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;namespace: System.Web.Routing - .Netframework 3.5 SP1 &lt;br /&gt;&lt;br /&gt;Initially, the ASP.Net routing engine is packed with the new ASP.Net MVC framework.&lt;br /&gt;&lt;br /&gt;In order to provide routing in asp.net application, we need to first define &lt;span style="font-weight:bold;"&gt;routes &lt;/span&gt;and &lt;span style="font-weight:bold;"&gt;routing handler&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;What is a Route?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; A route is a format or pattern of URL we define for application. The route can have placeholders and constant values. The place holders will be replaced with the values that we supply in the URL during processing.&lt;br /&gt;&lt;br /&gt;For example,&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;{controller}/{action}/{Category}  -- /products/list/cars or /product/list/phones&lt;br /&gt;&lt;br /&gt;Articles/{action}/{Category} --    /Articles/list/jQuery, /Articles/edit/jQuery&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A Route is processed and resolved to a virtual path by a route handler. Once we defined our routes, we need to define our route hander to handle the request that follows the route pattern.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;What is a RouteHandler?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A RouteHandler is an object that returns the instance of the actual ASP.NET page or HTTP Handler to complete the processing for the URL requested. A RouteHandler class should inherit the System.Web.Routing.IRouteHandler interface and implement GetHttpHandler() method.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-6437192874338444395?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.codedigest.com/Articles/ASPNET/294_Search_Engine_Friendly_URLs_Using_Routing_in_ASPNet_35.aspx' title='Routing - .net'/><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/6437192874338444395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=6437192874338444395&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/6437192874338444395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/6437192874338444395'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2010/01/routing-net.html' title='Routing - .net'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-6847633799595836122</id><published>2009-07-22T18:10:00.001+05:30</published><updated>2009-07-22T18:11:37.768+05:30</updated><title type='text'>Few example where to use typed dataset</title><content type='html'>Below are some example where you can use typed dataset:&lt;br /&gt;&lt;br /&gt;•The typed dataset isn't restricted to a table or even multiple tables. It can handle an XML file or even a text file by using a DataAdapter rather than a TableAdapter.&lt;br /&gt;•You can create a typed dataset that allows you to update several related tables simultaneously from a single user form.&lt;br /&gt;•You can display and use calculated values, even a value based on a column within the same record.&lt;br /&gt;•The typed dataset simplifies your job because it's a reusable object. Drag it onto a form and it waits for you to determine the bound object instead of providing a default object.&lt;br /&gt;•You can use multiple typed datasets on a form to handle related data, such as customers and orders.&lt;br /&gt;&lt;br /&gt;(I found these on Devexpress)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-6847633799595836122?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/6847633799595836122/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=6847633799595836122&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/6847633799595836122'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/6847633799595836122'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2009/07/few-example-where-to-use-typed-dataset.html' title='Few example where to use typed dataset'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-3150987803281490736</id><published>2009-07-21T15:06:00.004+05:30</published><updated>2009-07-21T15:13:42.488+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='blinking cursor textbox'/><title type='text'>set blinking cursor in textbox</title><content type='html'>This is really very simple.&lt;br /&gt;Use focus() and select() method.&lt;br /&gt;&lt;br /&gt;like ::&lt;br /&gt;&lt;br /&gt;     document.getElementById(txtBox).focus();&lt;br /&gt;     document.getElementById(txtBox).select();&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-3150987803281490736?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/3150987803281490736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=3150987803281490736&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/3150987803281490736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/3150987803281490736'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2009/07/set-blinking-cursor-in-textbox.html' title='set blinking cursor in textbox'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-4677974094526275249</id><published>2009-07-07T19:41:00.001+05:30</published><updated>2009-07-07T19:41:36.647+05:30</updated><title type='text'>hide/show column or hidden value in grid using client side code for ASP.NET</title><content type='html'>We all follow one problem with grid control that we need some value from one column but we do not want to display that value to user and this lead us to lots of problem.&lt;br /&gt;&lt;br /&gt;The very easy solution to this problem is user css property display:none in style.&lt;br /&gt;&lt;br /&gt;This is very easy to use and still we can get the control in javascript and get value.&lt;br /&gt;Example&lt;br /&gt;&lt;br /&gt;add label in templatecolumn :&lt;br /&gt;                             &lt;br /&gt;&lt;br /&gt;                                        asp:label id="lableid" runat="server" style=" style="display: none"&lt;br /&gt;&lt;br /&gt;and now using itedatabound event attach your javascript and sent clientid of you label control in that. Now you can use the value in your lable control.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-4677974094526275249?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/4677974094526275249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=4677974094526275249&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/4677974094526275249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/4677974094526275249'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2009/07/hideshow-column-or-hidden-value-in-grid.html' title='hide/show column or hidden value in grid using client side code for ASP.NET'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-2044613216315320611</id><published>2008-04-22T14:12:00.002+05:30</published><updated>2008-04-22T14:33:24.370+05:30</updated><title type='text'>Difference between Response.Redirect and Server.Transfer</title><content type='html'>This question was asked by a client "Difference between Response.Redirect and Server.Transfer"&lt;br /&gt;&lt;br /&gt;I thought oh! so simple question is this and as obvious my answer was&lt;br /&gt;&lt;br /&gt;Response.Redirect have a extra round trip to browser and Server.Transfer does not have a extra trip (As had gone through this difference a lots of time in the web and whenever I found on the same I found the answer as provided above)&lt;br /&gt;&lt;br /&gt;Now I am bowled&lt;br /&gt;Where would you use which one ?????&lt;br /&gt;&lt;br /&gt;Offfff I never thought of this...........&lt;br /&gt;&lt;br /&gt;So I have given a wrong answer... and result you must be sure about the Result.....&lt;br /&gt;&lt;br /&gt;So I decided to get the bottom of this and found one more interesting thing::&lt;br /&gt;&lt;br /&gt;Response.Redirect :: User is redirected to new URL and you needs to pass the values in query string  but not the page state.&lt;br /&gt;Server.Transfer :: You can pass the state of page to another page but use is not aware of transfer to  new URL as in the address bar URL remains the same, so he can not add to bookmark. This means that things like relative links / image paths may not work if you transfer to a page from a different directory.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-2044613216315320611?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/2044613216315320611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=2044613216315320611&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/2044613216315320611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/2044613216315320611'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2008/04/difference-between-responseredirect-and.html' title='Difference between Response.Redirect and Server.Transfer'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-7308532135888368143</id><published>2008-04-22T14:02:00.003+05:30</published><updated>2008-04-22T14:09:43.925+05:30</updated><title type='text'>God Help</title><content type='html'>Hi!!&lt;br /&gt;&lt;br /&gt;I have left my previous organization and joined a new CMMI 5 organization. No project has been allocated so far. This is very boring the initial days in a new company.&lt;br /&gt;&lt;br /&gt;No Project&lt;br /&gt;No Contacts&lt;br /&gt;No Mails&lt;br /&gt;No Messenger&lt;br /&gt;No Software’s are installed on the machine. Really very boring but I have found a solution for good time pass. Let’s read some book and then blog ;)&lt;br /&gt;Tomorrow onwards I will bring some book and will make sure no more boring days.&lt;br /&gt;Let’s read something interesting.............&lt;br /&gt;&lt;br /&gt;Offfffff the days are really bad. My PC motherboard was not working properly, so I send this for replacement. No chance at home also.&lt;br /&gt;&lt;br /&gt;Really this is hard to live without a machine installed VS.NET&lt;br /&gt;&lt;br /&gt;Good please save and provide me a machine with VS.NET (No more virtual labs... please god ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-7308532135888368143?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/7308532135888368143/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=7308532135888368143&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/7308532135888368143'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/7308532135888368143'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2008/04/god-help.html' title='God Help'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-3686254660330118994</id><published>2007-09-04T18:37:00.000+05:30</published><updated>2007-09-04T21:44:17.719+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Debug'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='BreakPoint'/><title type='text'>VS 2005 - The breakpoint will not currently be hit. No symbols loaded for this document.</title><content type='html'>Today something strange happen while just coding in ASP.NET with VS.NET 2005. Everything was just working fine, suddenly I got the error message :&lt;br /&gt;&lt;br /&gt;" VS 2005 - The breakpoint will not currently be hit. No symbols loaded for this document.  "&lt;br /&gt;&lt;br /&gt;I was not able to debug the code in .cs files. I tried to find out the solution on the net with searching  for " VS 2005 - The breakpoint will not currently be hit. No symbols loaded for this document.  "  in search engine. But no help. But I was sure here is some problem with the build process. Finally one thing I found one thing that this stores the some files at&lt;br /&gt;"C:\Documents and Settings\UserId or Name\Local Settings\Application Data".&lt;br /&gt;&lt;br /&gt;I deleted all the files in folder "Application Data"(exception few which I was not able to delete).&lt;br /&gt;Then this was the step I must have performed in step 1. Yes this was all done and I was able to debug my application.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-3686254660330118994?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/3686254660330118994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=3686254660330118994&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/3686254660330118994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/3686254660330118994'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2007/09/vs-2005-breakpoint-will-not-currently.html' title='VS 2005 - The breakpoint will not currently be hit. No symbols loaded for this document.'/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-5367099878948092995</id><published>2007-07-06T15:44:00.000+05:30</published><updated>2007-09-05T10:40:08.065+05:30</updated><title type='text'></title><content type='html'>&lt;DIV style="TEXT-ALIGN: center"&gt;&lt;FONT style="FONT-WEIGHT: bold; FONT-FAMILY: Georgia" color=#cc0000 size=3&gt;Questionnaire on SharePoint&lt;/FONT&gt;&lt;BR&gt;&lt;/DIV&gt; &lt;P&gt;&lt;FONT color=#3333ff&gt;&lt;STRONG&gt;Question 1   :   What you understand by WSS ?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt; &lt;P&gt;&lt;BR&gt;Answer 1     :   WSS stand for &lt;STRONG&gt;Windows SharePoint Server&lt;/STRONG&gt; and is freely available as a Windows 2003 server component. This is a collaboration tool that help people to stay connected across organization and geographic boundaries. &lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;WSS helps teams stay connected and productive by providing easy access to the people, documents, and information they need to make more informed decisions and get the job done.WSS provides a foundation platform for building Web-based business application that can flex and scale easily to meet the changing and growing needs of your business.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;Some of the feature of WSS:&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;UL&gt; &lt;LI&gt;Provide a single workspace for teams to coordinate schedules, organize documents, and participate in discussions—within the organization and over the internet.   &lt;LI&gt;Simplify the creation and navigation of workspaces with the improved user interface and site creation tools in Windows SharePoint Services 3.0 that provide easy-to-use templates, professional-looking site themes, and the ability to rearrange site navigation from within the browser.  &lt;LI&gt;Increase the security of business information with enhanced administrative controls that decrease cost and complexity associated with site provisioning, management, support, operations, and backup and restore.  &lt;LI&gt;Manage business documents more easily with enhanced document library support and a common repository for document storage.  &lt;LI&gt;Use the Windows SharePoint Services platform to build rich, flexible, and scalable Web-based applications and Internet sites specific to the needs of your organization.&lt;/LI&gt;&lt;/UL&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;&lt;FONT size=1&gt;By: Ravi Pahuja ( 05-June-2007 )&lt;/FONT&gt;&lt;/P&gt; &lt;P&gt;&lt;FONT size=1&gt; &lt;/P&gt; &lt;P&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#3333ff&gt;&lt;STRONG&gt;Question 2   :   What you understand by MOSS?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt; &lt;P&gt;&lt;BR&gt;Answer 2     :   MOSS stands for the &lt;STRONG&gt;Microsoft Office SharePoint Server&lt;/STRONG&gt;.  This is a new program which is part of the 2007 Microsoft Office System and this was designed to upgrade the WSS. Office SharePoint Server offers enhanced and additional feature that are unavailable on a Windows SharePoint Services site. &lt;/P&gt; &lt;P&gt;&lt;BR&gt;&lt;FONT size=1&gt;By: Ravi Pahuja ( 05-June-2007 )&lt;/FONT&gt;&lt;/P&gt; &lt;P&gt;&lt;FONT size=1&gt;&lt;/FONT&gt; &lt;/P&gt; &lt;P&gt;&lt;FONT size=1&gt;&lt;/FONT&gt; &lt;/P&gt; &lt;P&gt;&lt;FONT size=1&gt;&lt;/FONT&gt; &lt;/P&gt; &lt;P&gt;&lt;FONT color=#3333ff&gt;&lt;STRONG&gt;Question 3   :   A brief history of SharePoint?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt; &lt;P&gt;&lt;BR&gt;Answer 3     :   &lt;/P&gt; &lt;P&gt;&lt;STRONG&gt;Year 2001&lt;/STRONG&gt; : &lt;/P&gt; &lt;UL&gt; &lt;LI&gt; &lt;DIV&gt;SharePoint Team Services (STS) which ran on Windows 2000 Server and was in effect Windows SharePoint Services version 1. &lt;/DIV&gt; &lt;LI&gt; &lt;DIV&gt;SharePoint Portal Server 2001 - a portal based collaboration and document management tool developed on top of the Microsoft Exchange Server database. &lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;&lt;STRONG&gt;Year 2003&lt;/STRONG&gt; : &lt;/P&gt; &lt;UL&gt; &lt;LI&gt; &lt;DIV&gt;Windows SharePoint Services (WSS version 2) - which ran on Windows Server 2003, a free Windows server component that provides collaboration and intranet services. WSS v2 is based on the .Net 1.1 Framework. Support for the .Net 2.0 Framework was added in Service Pack 2. &lt;/DIV&gt; &lt;LI&gt; &lt;DIV&gt;Microsoft Office SharePoint Portal Server 2003 (SPS) - a portal based collaboration and document management that extends Windows SharePoint Services v2. &lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;&lt;STRONG&gt;Year 2006/7&lt;/STRONG&gt; : &lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;UL&gt; &lt;LI&gt; &lt;DIV&gt;&lt;STRONG&gt;Windows SharePoint Services 3.0 (WSS 3.0)&lt;/STRONG&gt; is freely available as a Windows 2003 server component. WSS 3.0 was based on the ASP.NET 2.0 and required .NET Framework 3.0. &lt;/DIV&gt; &lt;LI&gt; &lt;DIV&gt;&lt;STRONG&gt;Microsoft Office SharePoint Server 2007 (MOSS)&lt;/STRONG&gt; - The next iteration of Microsoft Office SharePoint Portal Server 2003 (SPS). Includes the functionality previously included in Microsoft Office SharePoint Portal Server 2003 (SPS 2003) and Microsoft Content Management Server 2002 (MCMS 2002) plus new components like Infopath Form Services and Excel Calculation Server. MOSS is based on WSS 3.0. &lt;BR&gt;&lt;BR&gt;&lt;FONT size=1&gt;By: Ravi Pahuja ( 05-June-2007 )&lt;/FONT&gt;&lt;BR&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt; &lt;P&gt;&lt;BR&gt; &lt;/P&gt; &lt;P&gt;&lt;FONT color=#3333ff&gt;&lt;STRONG&gt;Question 4   :   What we can achieve using SharePoint?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt; &lt;P&gt;&lt;BR&gt;Answer 4     :   Three major task which we can achieve using SharePoint is listed below:&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;OL&gt; &lt;LI&gt; &lt;DIV&gt;Collaborate on Projects&lt;/DIV&gt; &lt;LI&gt; &lt;DIV&gt;Share and Manage Information&lt;/DIV&gt; &lt;LI&gt; &lt;DIV&gt;Personal Customization&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt; &lt;P&gt; &lt;/P&gt; &lt;P&gt;1.) &lt;STRONG&gt;Collaborate on Projects: &lt;/STRONG&gt;We can use this as a collaborate tool for any kind of project. Site users share a common place made up of document libraries, lists and web parts on one or more tasks, projects or documents. Team member can work together on all these items. Windows® SharePoint™ Services lets you create a central location where coworkers, partners, and customers can share issues, contacts, announcements, Web links, and calendars. Team members can easily create workspaces for meeting discussions, surveys, documents, task lists, and other collaboration needs that increase their productivity.&lt;/P&gt; &lt;P&gt; &lt;/P&gt; &lt;UL&gt; &lt;LI&gt; &lt;DIV&gt;&lt;STRONG&gt;Document Workspaces :&lt;/STRONG&gt; Using Web parts, lists, and document libraries, a Document Workspace creates an environment centered on one or more tasks, projects, or documents. Team members can work together on a document (either the Document Workspace copy or their own copy) and periodically update copies that have been saved to the Document Workspace site.&lt;/DIV&gt; &lt;LI&gt; &lt;DIV&gt;&lt;STRONG&gt;Meeting Workspace :&lt;/STRONG&gt; A Meeting Workspace site is the most productive approach to workgroup collaboration. Similar to a Document Workspace site, it allows team members to manage meetings and documents by using Web parts, lists, and document libraries. &lt;BR&gt;Using Microsoft Outlook 2003, you can send meeting notices and invitations to team members. This will automatically create a Meeting Workspace, or you can create a Meeting Workspace in your SharePoint site by using a browser. You can include a hyperlink to the Workspace site where invitees can obtain additional information. You can also create a Meeting Workspace site for recurring meetings so team members can track the progress of ongoing tasks or projects.&lt;/DIV&gt; &lt;LI&gt; &lt;DIV&gt;&lt;STRONG&gt;Create Sites and Workspaces :&lt;/STRONG&gt; Your team members can create a site or workspace for collaboration on Web pages, lists, and document libraries, or they can create a site to manage a new team or project, collaborate on documents, or prepare for meetings. &lt;BR&gt;Enabling "Self-Service Site Creation" allows users to create their own top-level site, which eliminates the need for administrators to create one on demand. Users can click a link on the home page and enter information on the signup screen. Windows SharePoint Services will then create the new site with the user as the owner and administrator. For example, sales and marketing managers can create a site to manage all their sales- and marketing-related activities.&lt;/DIV&gt; &lt;LI&gt; &lt;DIV&gt;&lt;STRONG&gt;Discussion Boards :&lt;/STRONG&gt; Discussion boards provide a forum for topics that interest your team. For example, you can create a discussion board that allows team members to propose and discuss activities. Each discussion board has icons for starting, sorting, filtering, switching views, or changing designs. Another feature (Web Discussion) allows users to attach comments to a specific SharePoint page or document.&lt;/DIV&gt; &lt;LI&gt; &lt;DIV&gt;&lt;STRONG&gt;Team Surveys :&lt;/STRONG&gt; Surveys allow you to poll team members and obtain feedback from anyone with access to the site. You can configure a survey so that users can respond to items such as meetings, vendor service, or product releases, and you can also display the results graphically.&lt;/DIV&gt; &lt;LI&gt; &lt;DIV&gt;&lt;STRONG&gt;Automatic Notifications and Alerts : &lt;/STRONG&gt;SharePoint uses e-mail alerts to notify users of important events and changes to lists, items, libraries, and other parts of the site. For example, users can choose to receive an e-mail alert when a document published in a specific library is modified or deleted, or they can elect to receive immediate, daily, or weekly alerts for content included in the portal site index.&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt; &lt;P&gt; 2. )&lt;STRONG&gt;Share and Manage Information:&lt;/STRONG&gt; Windows® SharePoint™ Services lets you create a central location where coworkers, partners, and customers can share issues, contacts, announcements, Web links, and calendars. Team members can easily create workspaces for meeting discussions, surveys, documents, task lists, and other collaboration needs that increase their productivity.&lt;/P&gt; &lt;UL&gt; &lt;LI&gt; &lt;DIV&gt;&lt;STRONG&gt;Lists and Spreadsheets :&lt;/STRONG&gt; SharePoint sites include built-in lists for sharing information, tasks, contacts, and announcements. Users can also create custom lists for unique information. With the help of a compatible Windows program (such as Microsoft Office Professional 2003), Windows SharePoint Services will import in columnar form spreadsheet data that team members can directly edit, sort, filter, add to, or delete. To import data from a spreadsheet, you must have a compatible spreadsheet program such as Microsoft Office Excel 2003 or Internet Explorer 5&lt;/DIV&gt;&lt;/LI&gt; &lt;LI&gt; &lt;DIV&gt;&lt;STRONG&gt;Document and Forms Libraries:&lt;/STRONG&gt; Users can browse a library to share documents with team members. Document libraries support features such as sub-folders, file versioning, and check-in/check-out. Using a compatible XML editor (such as Microsoft Office InfoPath), you can create a form library for your XML-based business reports or purchase orders.&lt;/DIV&gt;&lt;/LI&gt; &lt;LI&gt; &lt;DIV&gt;&lt;STRONG&gt;Task, Event, Contact, and Announcement Lists :&lt;/STRONG&gt; Using an event list, you can post information about important dates or copy/link events to a compatible calendar program such as Microsoft Office Outlook 2003.You can use an announcement list to post news, status, and other information, and you can set an expiration date for the announcement.You can use a task list to assign a task to a team member, specify its priority and due date, and indicate its status and progress. Users can view individual tasks assigned to them or tasks assigned to other team members.With a contact list, you can allow team members to have access to a telephone number, e-mail address, or street address of clients, partners, and vendors. You can copy contact information in the address book to or from a contact list. This requires a compatible address book program such as Microsoft Office Outlook® 2003 or Microsoft Internet Explorer 4.0. &lt;/DIV&gt;&lt;/LI&gt; &lt;LI&gt; &lt;DIV&gt;&lt;STRONG&gt;Picture Libraries :&lt;/STRONG&gt; You can store photos and graphics in picture libraries that allow users to view images as thumbnails, filmstrips, or standard files. A picture library allows you to create a repository of corporate and product logos and images in order to standardize corporate images and simplify the daily operations of team members.&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt; &lt;P&gt;3.)&lt;STRONG&gt;Personal View Customization : &lt;/STRONG&gt;A SharePoint Page (for example, a site's home page) consists of Web Parts and can appear in either shared or personal view. In shared view edited by an administrator or users with specific permission rights, all users see the same page and same changes. &lt;BR&gt;In personal view, only the user making changes to Web Parts can view them; for example, if a user changes the height and width of one Web Part, closes another, adds a third, and deletes a fourth, the changes apply only to their view of the page.&lt;BR&gt;&lt;/P&gt; &lt;P&gt; &lt;/P&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-5367099878948092995?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/5367099878948092995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=5367099878948092995&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/5367099878948092995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/5367099878948092995'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2007/07/questionnaire-on-sharepoint-question-1.html' title=''/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3120602423723919508.post-5867928560599173893</id><published>2007-06-21T14:32:00.000+05:30</published><updated>2007-09-05T10:40:08.072+05:30</updated><title type='text'></title><content type='html'>&lt;p class="EC_MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;Hi,&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="EC_MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;         I have been learning the  computers since around 10 years.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="EC_MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;&lt;br&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;      &lt;p class="EC_MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;What learning since around 10 years  ? Yes 10 years !! As I learn everyday  something new so I say I am still learning. I have working on dotnet platform  these days and will discuss that only with you most of the times. I have created  a free site also at&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="EC_MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;&lt;br&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="EC_MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;http:\dotnetextract.googlepages.com&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="EC_MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;&lt;br&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;      &lt;p class="EC_MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;I started with the VB and  ASP. I have working on desktop  application with VB oh! yes once I created a COM component also with C++ and  some time I have worked on ASP also but these days I am working on dotnet  platform.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="EC_MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;&lt;br&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;p class="EC_MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;I thing Microsoft realized that he  has to survive then he has to beat Java in this own game and then dotnet comes.  Beat Java with java !! Quite interesting.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;p class="EC_MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;Oh! yes he beat Linux too. Sorry :)  but as per  my knowledge he beat why I am saying this is because most of the  desktop user use windows on their machine and we developer make application to  end user to use. Because men love to see beautiful ...... same a user want a  beautiful desktop and that is what Microsoft provided.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;p class="EC_MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;Have you remember pre Windows 95  days offffffff I was really too difficult to work with a PC. Then come 95,98,me,  xp cool men life comes a long way and now stylish too  Vista.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="EC_MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;&lt;br&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;p class="EC_MsoNormal"&gt;&lt;font face="Arial" size="2"&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;I love Microsoft. Whats about  you?&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3120602423723919508-5867928560599173893?l=ravi-pahuja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ravi-pahuja.blogspot.com/feeds/5867928560599173893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3120602423723919508&amp;postID=5867928560599173893&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/5867928560599173893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3120602423723919508/posts/default/5867928560599173893'/><link rel='alternate' type='text/html' href='http://ravi-pahuja.blogspot.com/2007/06/hi-i-have-been-learning-computers-since.html' title=''/><author><name>Live Life</name><uri>http://www.blogger.com/profile/05568480730186457124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
