<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3524275722329518940</id><updated>2026-07-21T11:13:54.314+05:30</updated><category term="Isolation levels"/><category term="LINQ"/><category term="Page Life Cycle"/><category term="datalist"/><category term="ASP.NET Cookieless Session"/><category term="Access the base class method with derived class"/><category term="Address header in WCF"/><category term="Ajax"/><category term="Asp.net frequently asked question"/><category term="C# interview question..."/><category term="CHARINDEX vs PATINDEX"/><category term="CROSS Apply and OUTER Apply"/><category term="CTE"/><category term="CTE in sql server"/><category term="Chain constructor or constructor chaining"/><category term="Clustered/Nonclustered Index"/><category term="Concept of polymorphism"/><category term="DELETE and DROP"/><category term="DLR"/><category term="Dead letter queues in WCF"/><category term="Debug vs Release Build"/><category term="Delay signing"/><category term="Difference between &quot;throw&quot; and &quot;throw ex&quot; in .NET"/><category term="Difference between Abstraction and Encapsulation????"/><category term="Garbage collection"/><category term="Generics in C#"/><category term="Gridview"/><category term="InstanceContextMode"/><category term="Layered vs tiered architecture"/><category term="Method Overloading in WCF"/><category term="Method Overloading in WebServices"/><category term="NULLIF  in sql"/><category term="OOPS frequently asked questions"/><category term="Primary key without clustered index"/><category term="RANK v DENSE_RANK v ROW_NUMBER"/><category term="Schemabinding View"/><category term="Security in WCF"/><category term="Serialization"/><category term="Serialization and Deserialization"/><category term="Session mode"/><category term="State Server"/><category term="TFS undo"/><category term="TRUNCATE"/><category term="Type of serialization"/><category term="Undo changes in tfs"/><category term="VerifyRenderingInServerForm"/><category term="Volatile queues in WCF"/><category term="WCF Sessions"/><category term="What&#39;s the Difference between WCF and Web Services?"/><category term="XML"/><category term="abstract class"/><category term="ado.net"/><category term="base constructor"/><category term="datagrid"/><category term="datareader"/><category term="dataset"/><category term="deleted table"/><category term="event and delegate"/><category term="extension methods"/><category term="finalize/dispose"/><category term="function and stored procedure"/><category term="inserted"/><category term="javascript"/><category term="jquery ajax"/><category term="json"/><category term="magic table"/><category term="magic tables"/><category term="remove lock in tfs"/><category term="repeater"/><category term="reverse using CTE"/><category term="session variable using javascript"/><category term="substring"/><category term="union/union all"/><category term="view state in server side"/><category term="web farm/web garden"/><category term="workspace in tfs"/><title type='text'>जगदीश खोलिया</title><subtitle type='html'>Visit जगदीश खोलिया @ http://jagdishkholiya.blogspot.in OR&#xa;http://jagdishkholiya.wordpress.com</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>82</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-8814668500275153003</id><published>2016-08-08T11:43:00.003+05:30</published><updated>2016-08-08T11:51:17.436+05:30</updated><title type='text'>Find Nth Highest Salary in a table and Highest Salary for each department in a table</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Find Nth Highest Salary in a table:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;CREATE&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;TABLE&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;EMP&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;NAME&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;VARCHAR&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;20&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;),&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;SALARY&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;INT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;DEPTNO&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;INT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot;; font-size: small;&quot;&gt;2nd Highest Salary in a table:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;WITH&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;TMPTBL&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;TOP&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; 2 &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;NAME&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;SALARY&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;EMP&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;ORDER&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;BY&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;SALARY&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;DESC&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;TOP&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; 1&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;*&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;TMPTBL&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;ORDER&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;BY&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;SALARY&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;Or Using Row_Number()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;WITH&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;CTE&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: magenta; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: magenta; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: magenta; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;ROW_NUMBER&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;OVER&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;ORDER&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;BY&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;SALARY&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;DESC&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;ROW&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;SALARY&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;DEPTNO&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;EMP&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;*&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;CTE&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;WHERE&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;ROW&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&amp;nbsp;2 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;Find Nth Highest Salary&amp;nbsp;for each department&amp;nbsp;in a table:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;WITH&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;CTE&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;AS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: magenta; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: magenta; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: magenta; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;ROW_NUMBER&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;OVER&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;PARTITION&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;BY&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;DEPTNO&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;ORDER&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;BY&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;SALARY&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;DESC&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;ROW&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;SALARY&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;DEPTNO&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;EMP&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;*&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;CTE&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;WHERE&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;ROW&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: x-small;&quot;&gt;2 &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/8814668500275153003/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/8814668500275153003' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/8814668500275153003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/8814668500275153003'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2016/08/find-nth-highest-salary-in-table-and.html' title='Find Nth Highest Salary in a table and Highest Salary for each department in a table'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-4776079248730102541</id><published>2014-02-17T13:13:00.000+05:30</published><updated>2014-02-17T13:13:03.754+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="session variable using javascript"/><title type='text'>Accessing &amp; Assigning the Session Variable using Javascript</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Georgia, serif; font-size: 14px; line-height: 21px; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Assigning the ASP.NET Session Variable using Javascript:&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Georgia, serif; font-size: 14px; line-height: 21px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;div class=&quot;syntaxhighlighter  jscript&quot; id=&quot;highlighter_600753&quot; style=&quot;border: 0px; font-family: inherit; font-size: 1em !important; font-style: inherit; font-weight: inherit; margin: 1em 0px !important; outline: 0px; overflow-x: auto !important; overflow-y: hidden !important; padding: 0px; position: relative !important; vertical-align: baseline; width: 460.59375px;&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-spacing: 0px; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 484px;&quot;&gt;&lt;tbody style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;gutter&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-right-color: rgb(108, 226, 108) !important; border-right-style: solid !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border-width: 0px 3px 0px 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 452px;&quot;&gt;&lt;div class=&quot;container&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: relative !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;jscript plain&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;lt;script type=&lt;/code&gt;&lt;code class=&quot;jscript string&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&quot;text/javascript&quot;&lt;/code&gt;&lt;code class=&quot;jscript plain&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;jscript keyword&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;jscript plain&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;SetUserName()&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;jscript plain&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;{&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;jscript spaces&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: #555555; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;jscript keyword&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;jscript plain&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;userName = &lt;/code&gt;&lt;code class=&quot;jscript string&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&quot;Jagdish Kholiya&quot;&lt;/code&gt;&lt;code class=&quot;jscript plain&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;jscript spaces&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: #555555; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;jscript string&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&#39;&amp;lt;%Session[&quot;UserName&quot;] = &quot;&#39;&lt;/code&gt; &lt;code class=&quot;jscript plain&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;+ userName + &lt;/code&gt;&lt;code class=&quot;jscript string&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&#39;&quot;; %&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;jscript plain&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;jscript spaces&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: #555555; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;jscript plain&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;alert(&lt;/code&gt;&lt;code class=&quot;jscript string&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&#39;&amp;lt;%=Session[&quot;UserName&quot;] %&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;jscript plain&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;jscript plain&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;jscript plain&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Georgia, serif; font-size: 14px; line-height: 21px; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Accessing ASP.NET Session variable using Javascript:&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #444444; font-family: Georgia, serif; font-size: 14px; line-height: 21px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;div class=&quot;syntaxhighlighter  jscript&quot; id=&quot;highlighter_763978&quot; style=&quot;border: 0px; font-family: inherit; font-size: 1em !important; font-style: inherit; font-weight: inherit; margin: 1em 0px !important; outline: 0px; overflow-x: auto !important; overflow-y: hidden !important; padding: 0px; position: relative !important; vertical-align: baseline; width: 460.59375px;&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-spacing: 0px; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 476px;&quot;&gt;&lt;tbody style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;tr style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;td class=&quot;gutter&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: rgb(175, 175, 175) !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-right-color: rgb(108, 226, 108) !important; border-right-style: solid !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border-width: 0px 3px 0px 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: 444px;&quot;&gt;&lt;div class=&quot;container&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: relative !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;jscript plain&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;lt;script type=&lt;/code&gt;&lt;code class=&quot;jscript string&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&quot;text/javascript&quot;&lt;/code&gt;&lt;code class=&quot;jscript plain&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;jscript spaces&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: #555555; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;jscript keyword&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;jscript plain&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;GetUserName()&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;jscript spaces&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: #555555; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;jscript plain&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;{&lt;/code&gt;&lt;span style=&quot;color: #444444; font-size: 1em; font-style: inherit; font-weight: inherit; line-height: 1.1em;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;jscript spaces&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: #555555; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;jscript keyword&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; font-weight: bold !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;jscript plain&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;username = &lt;/code&gt;&lt;code class=&quot;jscript string&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: blue !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&#39;&amp;lt;%= Session[&quot;UserName&quot;] %&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;jscript plain&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;jscript spaces&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: #555555; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;jscript plain&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;alert(username );&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;jscript spaces&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; color: #555555; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;jscript plain&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; float: none !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: pre !important; width: auto !important;&quot;&gt;
&lt;code class=&quot;jscript plain&quot; style=&quot;-webkit-box-shadow: none !important; background-image: none !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-shadow: none !important; box-sizing: content-box !important; direction: ltr !important; display: inline !important; float: none !important; font-family: Consolas, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, Courier, monospace !important; font-size: 1em !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/4776079248730102541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/4776079248730102541' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/4776079248730102541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/4776079248730102541'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2014/02/accessing-assigning-session-variable.html' title='Accessing &amp; Assigning the Session Variable using Javascript'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-3420322033888765024</id><published>2013-08-19T14:08:00.000+05:30</published><updated>2013-08-19T14:10:47.641+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="remove lock in tfs"/><category scheme="http://www.blogger.com/atom/ns#" term="TFS undo"/><category scheme="http://www.blogger.com/atom/ns#" term="Undo changes in tfs"/><category scheme="http://www.blogger.com/atom/ns#" term="workspace in tfs"/><title type='text'>Undo Changes (Remove lock) in another User&#39;s Workspace in TFS</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 class=&quot;procedureSubHeading&quot; style=&quot;font-family: &#39;Segoe UI Semibold&#39;, &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 1.231em; font-weight: normal; margin: 0px; padding-bottom: 5px; padding-top: 5px;&quot;&gt;
To undo another user&#39;s lock&lt;/h3&gt;
&lt;div class=&quot;subSection&quot;&gt;
&lt;ol&gt;
&lt;li style=&quot;font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 17px;&quot;&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Click&amp;nbsp;&lt;span class=&quot;label&quot; style=&quot;font-weight: 700;&quot;&gt;Start&lt;/span&gt;, click&amp;nbsp;&lt;span class=&quot;label&quot; style=&quot;font-weight: 700;&quot;&gt;All Programs&lt;/span&gt;, click&amp;nbsp;&lt;span class=&quot;label&quot; style=&quot;font-weight: 700;&quot;&gt;Microsoft Visual Studio 2008/10&lt;/span&gt;, click&amp;nbsp;&lt;span class=&quot;label&quot; style=&quot;font-weight: 700;&quot;&gt;Visual Studio Tools&lt;/span&gt;, and then click&amp;nbsp;&lt;span class=&quot;label&quot; style=&quot;font-weight: 700;&quot;&gt;Visual Studio Command Prompt&lt;/span&gt;.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;div style=&quot;font-size: 13px;&quot;&gt;
Type the following command and replace the arguments with the appropriate parameter information for your needs:&lt;/div&gt;
&lt;strong&gt;tf undo /workspace:&lt;/strong&gt;&lt;span class=&quot;parameter&quot; style=&quot;font-style: italic;&quot;&gt;OtherUser&#39;sWorkspace&lt;/span&gt;;&lt;span class=&quot;parameter&quot; style=&quot;font-style: italic;&quot;&gt;OtherUser $/TeamProject/File.cs /s:http://YourTFSServer:8080&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;parameter&quot; style=&quot;font-style: italic;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;i&gt;&lt;b&gt;eg:&lt;/b&gt;&amp;nbsp;&lt;/i&gt;&lt;i&gt;tf undo /workspace:II-SW-DSK-009;CORP\Jagdish.Kholiya $/BimaExpress/BimaExpress_V1.0/BimaExpress/BimaExpress.Services/BimaExpress.Services.csproj /s:http://ii-srv-dev-03:8080/tfs&lt;/i&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/3420322033888765024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/3420322033888765024' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/3420322033888765024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/3420322033888765024'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2013/08/undo-changes-remove-lock-in-another.html' title='Undo Changes (Remove lock) in another User&#39;s Workspace in TFS'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-6248129575760794370</id><published>2013-07-09T13:03:00.000+05:30</published><updated>2013-07-09T13:03:23.716+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="datalist"/><title type='text'>Find table row id (inside HeaderTemplate) in a DataList control</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Below is the code for finding table row id inside a datalist control:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;protected void datalistData_ItemDataBound(object sender, DataListItemEventArgs e)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;if (e.Item.ItemType == ListItemType.Header)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;HtmlControl trTableRow = e.Item.FindControl(&quot;trOffline&quot;) as HtmlControl;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//where trOffline is row id&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/6248129575760794370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/6248129575760794370' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/6248129575760794370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/6248129575760794370'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2013/07/find-table-row-id-inside-headertemplate.html' title='Find table row id (inside HeaderTemplate) in a DataList control'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-7514259918025024797</id><published>2013-04-29T12:50:00.002+05:30</published><updated>2013-04-29T12:53:08.342+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="extension methods"/><title type='text'>Extension Methods</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Extension methods allow you to easily extend a type, such as an &lt;/span&gt;&lt;span style=&quot;background-color: white; font-size: 15px;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Courier New, Courier, mono;&quot;&gt;&lt;b&gt;integer&lt;span style=&quot;color: #990000;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;or&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;&lt;b&gt;string&lt;/b&gt;&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;, without re-compiling or modifying the type or&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Segoe UI&#39;, Helvetica, Garuda, Arial, sans-serif; font-size: 14px; line-height: 21px;&quot;&gt;Extension methods enable you to &quot;add&quot; methods to existing types without creating a new derived type.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Segoe UI&#39;, Helvetica, Garuda, Arial, sans-serif; font-size: 14px; line-height: 21px;&quot;&gt;Extension methods are a special kind of static method (shared in vb) ,&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Segoe UI&#39;, Helvetica, Garuda, Arial, sans-serif; font-size: 14px; line-height: 21px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;but they are called as if the method is native to the type.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;One important thing to extension methods is if that you create an extension method with the same name as another method in that type, the compiler will bind the method call to the native method, not any extension. An extension method is only called when there is no native method found.&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3524275722329518940&quot; name=&quot;how&quot; style=&quot;border: 0px; color: inherit; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; margin: 0px; padding: 0px;&quot;&gt;&lt;br /&gt;&lt;/a&gt;
Steps To Create Extension Methods?&lt;br /&gt;
&lt;ol style=&quot;background-color: white; border: 0px; margin: 10px 0px; padding: 0px 0px 0px 40px;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Create a&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;public static&lt;/code&gt;&lt;span style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;class. e.g. :&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;public static class Extensions&lt;/span&gt;&lt;span style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;{ &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;}&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #111111; font-family: Segoe UI, Arial, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;Define functions.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;public static class Extensions&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;
&lt;/span&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; public string GetFirstThreeCharacters(String str)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(str.Length &amp;lt; 3)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return str;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return str.Substring(0,3);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;
&lt;/span&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp; 3.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Make the functions an extension method.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;To make our C# version of our function, we need an extension method to mark the function as&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;&lt;b&gt;static&lt;/b&gt;&lt;/code&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;(so that it can be accessed at any time without the need for declaring anything) and secondly, mark the first parameter with the&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;&lt;b&gt;this&lt;/b&gt;&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;keyword. This keyword basically tells the CLR that when this extension method is called, to use &quot;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;&lt;b&gt;this&lt;/b&gt;&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&quot; parameter as the source. See the following:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;public static class Extensions&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;
&lt;/span&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; public static string GetFirstThreeCharacters(this String str)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(str.Length &amp;lt; 3)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return str;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return str.Substring(0,3);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; }&lt;/div&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/7514259918025024797/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/7514259918025024797' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/7514259918025024797'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/7514259918025024797'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2013/04/extension-methods.html' title='Extension Methods'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-1420142826622631170</id><published>2013-03-04T12:45:00.000+05:30</published><updated>2013-03-04T12:45:37.724+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Delay signing"/><title type='text'>Delay signing</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;During development process you will need strong name keys to be exposed to developer which is not a good practice from security&lt;span style=&quot;color: #000096; font-family: inherit !important; font-size: inherit !important; font-weight: inherit !important; position: static;&quot;&gt;&lt;span class=&quot;kLink&quot; style=&quot;background-color: transparent; border-bottom: 1px solid rgb(0, 0, 150); color: rgb(0, 0, 150) ! important; font-family: inherit ! important; font-size: inherit ! important; font-weight: inherit ! important; position: static;&quot;&gt;&lt;/span&gt;&lt;/span&gt; point of view.In such situations you can assign the key later on and during development you can use delay signing.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;span class=&quot;answers&quot;&gt;Delay signing allows you to place a shared assembly in the GAC by 
signing the assembly with just the public key. This allows the assembly 
to be signed with the private key at a later stage, when the development 
process is complete and the component or assembly is ready to be 
deployed. This process enables developers to work with shared assemblies 
as if they were strongly named, and it secures the private key of the 
signature from being accessed at different stages of development.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;span class=&quot;answers&quot;&gt;More you can find out in this link:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;span class=&quot;answers&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/t07a3dye.aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/t07a3dye.aspx&lt;/a&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/1420142826622631170/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/1420142826622631170' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/1420142826622631170'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/1420142826622631170'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2013/03/delay-signing.html' title='Delay signing'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>Gurgaon, Haryana, India</georss:featurename><georss:point>28.4594965 77.026638300000059</georss:point><georss:box>28.236060000000002 76.703914800000064 28.682933 77.349361800000054</georss:box></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-904167670120590832</id><published>2013-02-27T14:16:00.004+05:30</published><updated>2013-02-27T14:16:41.129+05:30</updated><title type='text'>Finding duplicate records from a table in sql server</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;&amp;nbsp;By using row_number()&lt;/b&gt; &lt;b&gt;function&lt;/b&gt; :&lt;br /&gt;
;with dup as(select customer_id, firstname,lastname,row_number() over(partition by firstname,&lt;br /&gt;
lastname order by customer_id desc) as numOfDup from customer_details)&lt;br /&gt;select * from dup where numOfDup &amp;gt; 1 order by customer_id&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;By using dense_rank()&lt;/b&gt; &lt;b&gt;function&lt;/b&gt; :&lt;br /&gt;;with dup as(select customer_id,firstname,lastname,dense_rank() over(partition by firstname,lastname&lt;br /&gt;
order by customer_id desc) as numOfDup from customer_details)&lt;br /&gt;select * from dup where numOfDup &amp;gt; 1 order by customer_id&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;b&gt;&amp;nbsp;By using rank()&lt;/b&gt; &lt;b&gt;function&lt;/b&gt; :&lt;br /&gt;
;with dup as(select customer_id,firstname,lastname,rank() over(partition by firstname,lastname&lt;br /&gt;
order by customer_id desc) as numOfDup from customer_details)&lt;br /&gt;select * from dup where numOfDup &amp;gt; 1 order by customer_id&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;By using self join()&lt;/b&gt;&lt;br /&gt;select distinct cd1.customer_id,cd1.firstname,cd1.lastname from customer_details cd1&lt;br /&gt;
join customer_details cd2&lt;br /&gt;on cd1.firstname=cd2.firstname&lt;br /&gt;and cd1.lastname=cd2.lastname&lt;br /&gt;and cd1.customer_id &amp;gt; cd2.customer_id order by cd1.customer_id&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;By using sub query&lt;/b&gt;&lt;br /&gt;SELECT * FROM customer_details&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE customer_id NOT IN (SELECT MIN(customer_id)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM customer_details&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GROUP BY FirstName, LastName)&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/904167670120590832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/904167670120590832' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/904167670120590832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/904167670120590832'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2013/02/finding-duplicate-records-from-table-in.html' title='Finding duplicate records from a table in sql server'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>Gurgaon, Haryana, India</georss:featurename><georss:point>28.4594965 77.026638300000059</georss:point><georss:box>28.236060000000002 76.703914800000064 28.682933 77.349361800000054</georss:box></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-4147607686069214300</id><published>2013-02-12T18:19:00.000+05:30</published><updated>2013-02-12T18:21:52.856+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Gridview"/><category scheme="http://www.blogger.com/atom/ns#" term="VerifyRenderingInServerForm"/><title type='text'>Control &#39;grid 1&#39; of type &#39;GridView&#39; must be placed inside a form tag with runat=server.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre class=&quot;lang-cs prettyprint prettyprinted&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;code&gt;&lt;span class=&quot;pun&quot;&gt;Because calling GridView.&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span class=&quot;pun&quot;&gt;&lt;code&gt;RenderControl(htmlTextWriter)raises&amp;nbsp;&lt;/code&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-cs prettyprint prettyprinted&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;code&gt;&lt;span class=&quot;pun&quot;&gt;&lt;code&gt;an exception that aserver control was rendered outside of a form.&lt;/code&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-cs prettyprint prettyprinted&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;code&gt;&lt;span class=&quot;pun&quot;&gt;&lt;code&gt;We can avoid this exception byoverriding &lt;/code&gt;&lt;/span&gt;&lt;/code&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.web.ui.page.verifyrenderinginserverform.aspx&quot;&gt;VerifyRenderingInServerForm&lt;/a&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-cs prettyprint prettyprinted&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-cs prettyprint prettyprinted&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;code&gt;&lt;span class=&quot;kwd&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;override&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;VerifyRenderingInServerForm&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Control&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; control&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;/* Confirms that an HtmlForm control is rendered&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-cs prettyprint prettyprinted&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;code&gt;&lt;span class=&quot;com&quot;&gt;    &amp;nbsp;for the specified ASP.NET
     server control at run time. */&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/code&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-cs prettyprint prettyprinted&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-cs prettyprint prettyprinted&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;*Note that there is nothing inside the function.&lt;code&gt;&lt;span class=&quot;pun&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;code&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt; &lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-cs prettyprint prettyprinted&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;code&gt;&lt;span class=&quot;pun&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;code&gt;&amp;nbsp;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/4147607686069214300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/4147607686069214300' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/4147607686069214300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/4147607686069214300'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2013/02/control-grid-1-of-type-gridview-must-be.html' title='Control &#39;grid 1&#39; of type &#39;GridView&#39; must be placed inside a form tag with runat=server.'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-2801887527083464254</id><published>2013-01-31T11:58:00.003+05:30</published><updated>2013-01-31T12:02:40.890+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="InstanceContextMode"/><category scheme="http://www.blogger.com/atom/ns#" term="Session mode"/><category scheme="http://www.blogger.com/atom/ns#" term="WCF Sessions"/><title type='text'>WCF Sessions</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;WCF sessions are different than the session object in ASP.NET , support different behaviors, and are controlled in 
different ways.&lt;span style=&quot;line-height: 115%;&quot;&gt;WCF sessions are very different from ASP.NET Sessions. In short,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;ASP.NET Sessions are:&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Always server-initiated.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Implicitly unordered.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Provide a way to preserve data across multiple requests.There is 
unique session id generated at the server and passed back and forth 
between client and server via URL or cookies.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;WCF Sessions are:&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Initiated and terminated by the calling application (WCF Client).&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Ordered message delivery.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Sessions correlate a group of messages into a conversation.This 
correlation depdending upon the binding can be taken care at message or 
transport level.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;No data storage is involved with WCF Session. &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;To configure sessions in WCF, one should know the following three elements: &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;

&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;&lt;code&gt;Binding &lt;/code&gt;&lt;/b&gt;– Because all bindings do not support sessions. Only &lt;b&gt;WS-*, NetTcpBinding and &lt;/b&gt;&lt;code&gt;&lt;b&gt;NetNamedPipeBinding&lt;/b&gt; &lt;/code&gt;have session support so selection of appropriate binding is necessary. &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;&lt;code&gt;SessionMode &lt;/code&gt;&lt;/b&gt;– This service contract specifies service’s
 possible expectation for session from incoming client request. It has 
three self describing values: 
&lt;br /&gt;&lt;code&gt;*)Allowed &lt;/code&gt;– Service can accept sessionful clients as well as sessionless. &lt;br /&gt;&lt;code&gt;*)Required &lt;/code&gt;– Service will entertain only those clients who have session, sessionless client cannot&amp;nbsp;&amp;nbsp;&amp;nbsp; connect to service. &lt;br /&gt;&lt;code&gt;*)NotAllowed &lt;/code&gt;– Service can interact only with sessionless clients. Just opposite to &lt;code&gt;Required&lt;/code&gt;. &lt;/span&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;code&gt;&lt;b&gt;InstanceContextMode&lt;/b&gt; &lt;/code&gt;– This is a service behavior that controls instantiation of actual service class. It has the following values: 
&lt;br /&gt;&lt;code&gt;*)PerCall &lt;/code&gt;– Each request made to server will be served by a new instance of service class. &lt;br /&gt;&lt;code&gt;*)PerSession &lt;/code&gt;– A Session will have its dedicated service 
instance and all requests pertaining to the session will be served by 
that instance only. All sessions will have their individual dedicated 
service instances. &lt;br /&gt;&lt;code&gt;*)Single &lt;/code&gt;–All requests to the service will be served by a single unique instance of service class.&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;There are 3 things to remember for WCF session:

&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;1) &lt;b&gt;Sessionful &lt;/b&gt;&lt;/code&gt;binding.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre id=&quot;pre0&quot; lang=&quot;xml&quot; style=&quot;margin-top: 0px; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt; &lt;span class=&quot;code-keyword&quot;&gt;     (&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre id=&quot;pre0&quot; lang=&quot;xml&quot; style=&quot;margin-top: 0px; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;          &amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;endpoint&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;address&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;http://localhost:750&quot;&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;binding&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&lt;b&gt;wsHttpBinding&lt;/b&gt;&quot;&lt;/span&gt; 
           &lt;span class=&quot;code-attribute&quot;&gt;contract&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;wcfservice.Iservice&quot;&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;wcfSessionTest&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; )&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;2) &lt;b&gt;SessionMode &lt;/b&gt;&lt;/code&gt;service contract. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;   (&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;      [ServiceContract(SessionMode = SessionMode.&lt;span style=&quot;font-size: small;&quot;&gt;Allowed&lt;/span&gt;)]&lt;/b&gt;
    &lt;span class=&quot;code-keyword&quot;&gt;  public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;interface&lt;/span&gt; Iservice 
      {
      &lt;span class=&quot;code-comment&quot;&gt;   //&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;some code…
&lt;/span&gt;      }&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;   )&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;&amp;nbsp;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;3) &lt;b&gt;InstanceContextMode &lt;/b&gt;&lt;/code&gt;service behavior. &lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&amp;nbsp;&lt;span class=&quot;code-keyword&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;class&lt;/span&gt; serviceclass : Iservice&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
      &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; some code…
&lt;/span&gt;   }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/2801887527083464254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/2801887527083464254' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/2801887527083464254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/2801887527083464254'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2013/01/wcf-sessions.html' title='WCF Sessions'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>Gurgaon, Haryana, India</georss:featurename><georss:point>28.437298668550063 77.0416259765625</georss:point><georss:box>28.213862168550065 76.7189024765625 28.660735168550062 77.3643494765625</georss:box></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-3253026548889351474</id><published>2012-12-14T12:18:00.000+05:30</published><updated>2012-12-14T12:19:24.429+05:30</updated><title type='text'>Delegate with example</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;i&gt;Delegate is a type which&amp;nbsp; holds the method(s) reference in an object. It is also referred to as a type safe function pointer. 

&lt;/i&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3&gt;
Advantages&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Encapsulating the method&#39;s call from caller &lt;/li&gt;
&lt;li&gt;Effective use of delegate improves the performance of application &lt;/li&gt;
&lt;li&gt;Used to call a method asynchronously&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h3&gt;
Declaration&lt;/h3&gt;
&lt;pre id=&quot;pre0&quot; lang=&quot;text&quot; style=&quot;margin-top: 0px;&quot;&gt;public delegate type_of_delegate delegate_name()&lt;/pre&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;Example: &lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain1&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.codeproject.com/Articles/11657/Understanding-Delegates-in-C#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre1&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;delegate&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; mydelegate(&lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; delvar1,&lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; delvar2)&lt;/pre&gt;
&lt;h3&gt;
Note&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;You can use &lt;span class=&quot;search-highlight&quot;&gt;delegates&lt;/span&gt; without parameters or with parameter list &lt;/li&gt;
&lt;li&gt;You should follow the same syntax as in the method &lt;br /&gt;(If you are referring to the method with two &lt;code&gt;int &lt;/code&gt;parameters and &lt;code&gt;int &lt;/code&gt;return
 type, the delegate which you are declaring should be in the same 
format. This is why it is referred to as type safe function pointer.)&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;&amp;nbsp;Sample program using delegate :&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre id=&quot;pre2&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;delegate&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;double&lt;/span&gt; Delegate_MyFirst(&lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; Num1,&lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; Num2);
&lt;span class=&quot;code-keyword&quot;&gt;class&lt;/span&gt; Class1
{
    &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;double&lt;/span&gt; AddVal(&lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; val1,&lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; val2)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; val1 + val2;
    }
    &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; Main(&lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt;[] args)
    {
        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;Creating the Delegate Instance
&lt;/span&gt;        Delegate_MyFirst Objdel = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Delegate_MyFirst(AddVal);
        Console.Write(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Please Enter Values&quot;&lt;/span&gt;);
        &lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; v1 = &lt;span class=&quot;code-SDKkeyword&quot;&gt;Int32&lt;/span&gt;.Parse(Console.ReadLine());
        &lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; v2 = &lt;span class=&quot;code-SDKkeyword&quot;&gt;Int32&lt;/span&gt;.Parse(Console.ReadLine());
        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;use delegate for processing
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;double&lt;/span&gt; dblResult = Objdel(v1,v2);
        Console.WriteLine (&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Result :&quot;&lt;/span&gt;+dblResult);
        Console.ReadLine();
    }
}&lt;/pre&gt;
&lt;br /&gt;
&lt;h2&gt;
Multicast Delegate &lt;/h2&gt;
&lt;h3&gt;
What is Multicast Delegate? &lt;/h3&gt;
It is a delegate which holds the reference of more than one method. &lt;br /&gt;
Multicast &lt;span class=&quot;search-highlight&quot;&gt;delegates&lt;/span&gt; must contain only methods that return &lt;code&gt;void&lt;/code&gt;, else there is a run-time exception. &lt;br /&gt;
&lt;h3&gt;
Simple Program using Multicast Delegate &lt;/h3&gt;
&lt;pre id=&quot;pre5&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;delegate&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; Delegate_Multicast(&lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; x, &lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; y);
Class Class2
{
    &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; Method1(&lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; x, &lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; y)
    {
        Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;You r in Method 1&quot;&lt;/span&gt;);
    }

    &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; Method2(&lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; x, &lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; y)
    {
        Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;You r in Method 2&quot;&lt;/span&gt;);
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; Main&lt;span class=&quot;code-attribute&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;code-attribute&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot;&gt;Delegate_Multicast&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;func&lt;/span&gt; = &lt;span class=&quot;code-attribute&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;Delegate_Multicast(Method1);&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;+&lt;/span&gt;= &lt;span class=&quot;code-attribute&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;Delegate_Multicast(Method2);&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot;&gt;func(1,2);&lt;/span&gt;             &lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;Method1&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;Method2&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;are&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;called&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot;&gt;func&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;-&lt;/span&gt;= &lt;span class=&quot;code-attribute&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;Delegate_Multicast(Method1);&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot;&gt;func(2,3);&lt;/span&gt;             &lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;Only&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;Method2&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;called&lt;/span&gt;
    &lt;span class=&quot;code-attribute&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;pre id=&quot;pre5&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-attribute&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre id=&quot;pre5&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-attribute&quot;&gt;&lt;code&gt;Delegate &lt;/code&gt;is added using the &lt;code&gt;+=&lt;/code&gt; operator and removed &lt;/span&gt;&lt;/pre&gt;
&lt;pre id=&quot;pre5&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-attribute&quot;&gt;using the&amp;nbsp;&lt;code&gt;-=&lt;/code&gt; operator. &amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/3253026548889351474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/3253026548889351474' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/3253026548889351474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/3253026548889351474'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2012/12/delegate-with-example.html' title='Delegate with example'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-1144447323630967096</id><published>2012-10-25T16:51:00.000+05:30</published><updated>2012-10-25T16:59:01.128+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="CHARINDEX vs PATINDEX"/><category scheme="http://www.blogger.com/atom/ns#" term="substring"/><title type='text'>CHARINDEX vs PATINDEX</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
The CHARINDEX and PATINDEX 
functions return the starting position of a pattern you specify.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Both functions take 2 parameters.For CHARINDEX, the 
pattern cannot include wildcard characters.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
With 
PATINDEX, you must include percent signs before and after the pattern, 
unless you are looking for the pattern as the first (omit the first %) 
or last (omit the last %) characters in a column.&amp;nbsp; The second argument is a 
character expression&amp;nbsp; in which searches for the specified pattern.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Retrive File Extension from given File Name&amp;nbsp;
using charindex and patindex :&lt;/b&gt;&lt;/div&gt;
&lt;b&gt;Example of CHARINDEX:&lt;/b&gt;&lt;br /&gt;
&lt;code style=&quot;font-size: 12px;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;DECLARE @FileName VARCHAR(200)&lt;br /&gt;SET @FileName=&#39;jagdish.doc&#39;&lt;br /&gt;SELECT SUBSTRING(@FileName,charindex(&#39;.&#39;, @FileName)+1 ,LEN(@FileName)) AS Extention &lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;GO&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;b&gt;Examples of PATINDEX:&lt;/b&gt;&lt;br /&gt;
&lt;code style=&quot;font-size: 12px;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;DECLARE @FileName VARCHAR(200)&lt;br /&gt;SET @FileName=&#39;jagdish.doc&#39;&lt;br /&gt;SELECT SUBSTRING(@FileName,patindex(&#39;%.%&#39;, @FileName)+1 ,LEN(@FileName)) AS Extention &lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/1144447323630967096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/1144447323630967096' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/1144447323630967096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/1144447323630967096'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2012/10/charindex-vs-patindex.html' title='CHARINDEX vs PATINDEX'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-6116045311921453796</id><published>2012-08-16T14:59:00.000+05:30</published><updated>2013-05-07T12:32:36.841+05:30</updated><title type='text'>Post data to external URL </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&amp;nbsp;Java script code for posting data to external URL: &lt;br /&gt;
&amp;nbsp;There are 2 Methods of doing this:&lt;br /&gt;
&lt;b&gt;1)&lt;/b&gt; &amp;nbsp;&amp;lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&amp;gt; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function submitForm(formName, formAction, newWindow) {&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; var arrayStr = document.getElementById(&#39;&amp;lt;%= hdnData.ClientID %&amp;gt;&#39;).value;&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; var frm = createForm(formName, formAction, newWindow);&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; var inputArray = arrayStr.split(&#39;&amp;amp;&#39;);&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; for (var j = 0; j &amp;lt; inputArray.length; j++) {&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; var temp = inputArray[j].split(&#39;=&#39;);&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; if (isArray(temp) &amp;amp;&amp;amp; temp.length == 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; createfrmInuput(frm, temp[0], temp[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; }&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; frm.submit();&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; //Check whether variable is array&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function isArray(obj) {&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; if (obj.constructor.toString().indexOf(&#39;Array&#39;) == -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; return false;&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; else&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; return true;&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; function createForm(name, action, newWindow) {&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; var frmJagdish= document.createElement(&#39;FORM&#39;);&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; frmJagdish.method = &#39;POST&#39;;&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; frmJagdish.name = name;&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; frmJagdish.action = action;&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; //if (newWindow)&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; //frmJagdish.target = &#39;_blank&#39;;&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; document.body.appendChild(frmJagdish);&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; return frmJagdish;&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; function createfrmInuput(parentForm, name, value) {&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; var inuptVar = document.createElement(&#39;INPUT&#39;);&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; inuptVar.type = &#39;hidden&#39;;&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; inuptVar.name = name;&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; inuptVar.value = value;&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; parentForm.appendChild(inuptVar);&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;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;ASP.Net design :&lt;/b&gt;&lt;br /&gt;
&amp;lt;body onload=&quot;submitForm(&#39;PostedData&#39;,&#39;http://jagdishkholiya.blogspot.com&#39;,true);return false;&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;form id=&quot;frmJagdish&quot; runat=&quot;server&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:HiddenField ID=&quot;hdnData&quot; runat=&quot;server&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Code behind :&lt;/b&gt;&lt;br /&gt;
hdnData.Value = &quot;firstname=jagdish&amp;amp;lastname=kholiya&amp;amp;mobileno=9999999999&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;2)&amp;nbsp;&lt;/b&gt;&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;head &amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;form id=&quot;frmTest&quot; method=&quot;post&quot; action=&quot;http://jagdishkholiya.blogspot.in&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; runat=&quot;server&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;asp:HiddenField ID=&quot;firstname&quot; runat=&quot;server&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;asp:HiddenField ID=&quot;lastname&quot; runat=&quot;server&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;asp:HiddenField ID=&quot;mobilenumber&quot; runat=&quot;server&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;asp:HiddenField ID=&quot;city&quot; runat=&quot;server&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;asp:HiddenField ID=&quot;email&quot; runat=&quot;server&quot; /&amp;gt; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; document.forms[0].submit();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Code Behind:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; firstname.Value =&quot;Jagdish&quot;;&lt;br /&gt;
&amp;nbsp; lastname.Value = &quot;Kholiya&quot;;&lt;br /&gt;
&amp;nbsp; mobilenumber.Value =&quot;9999999999&quot;; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; city.Value = &quot;Gurgaon&quot;;&lt;br /&gt;
&amp;nbsp; email.Value = &quot;jagdish.kholiya@gmail.com&quot;;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/6116045311921453796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/6116045311921453796' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/6116045311921453796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/6116045311921453796'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2012/08/post-data-to-external-url.html' title='Post data to external URL '/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-759555455759653294</id><published>2012-07-12T16:03:00.000+05:30</published><updated>2012-07-12T16:03:05.709+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="What&#39;s the Difference between WCF and Web Services?"/><title type='text'>What&#39;s the Difference between WCF and Web Services?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;h4 style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;Web Service in ASP.NET&lt;/h4&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;A Web Service is programmable application logic accessible via standard Web protocols. One of these Web protocols is the Simple Object Access Protocol (SOAP). SOAP is a W3C submitted note (as of May 2000) that uses standards based technologies (XML for data description and HTTP for transport) to encode and transmit application data.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;Consumers of a Web Service do not need to know anything about the platform, object model, or programming language used to implement the service; they only need to understand how to send and receive SOAP messages (HTTP and XML).&lt;/div&gt;&lt;h4 style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;WCF Service&lt;/h4&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;Windows Communication Foundation (WCF) is a framework for building service-oriented applications. Using WCF, you can send data as asynchronous messages from one service endpoint to another. A service endpoint can be part of a continuously available service hosted by IIS, or it can be a service hosted in an application. An endpoint can be a client of a service that requests data from a service endpoint. The messages can be as simple as a single character or word sent as XML, or as complex as a stream of binary data.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;&lt;strong&gt;In what scenarios must WCF be used&lt;/strong&gt;&lt;/div&gt;&lt;ul style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot; type=&quot;disc&quot;&gt;&lt;li style=&quot;font-size: 10pt;&quot;&gt;A secure service to process business transactions.&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;A service that supplies current data to others, such as a traffic report or other monitoring service.&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;A chat service that allows two people to communicate or exchange data in real time.&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;A dashboard application that polls one or more services for data and presents it in a logical presentation.&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;Exposing a workflow implemented using Windows Workflow Foundation as a WCF service.&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;A Silverlight application to poll a service for the latest data feeds.&lt;/li&gt;
&lt;/ul&gt;&lt;h4 style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;Features of WCF&lt;/h4&gt;&lt;ul style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot; type=&quot;disc&quot;&gt;&lt;li style=&quot;font-size: 10pt;&quot;&gt;Service Orientation&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;Interoperability&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;Multiple Message Patterns&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;Service Metadata&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;Data Contracts&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;Security&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;Multiple Transports and Encodings&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;Reliable and Queued Messages&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;Durable Messages&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;Transactions&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;AJAX and REST Support&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;Extensibility&lt;/li&gt;
&lt;/ul&gt;&lt;h4 style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;Difference between Web Service in ASP.NET &amp;amp; WCF Service&lt;/h4&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;WCF is a replacement for all earlier web service technologies from Microsoft. It also does a lot more than what is traditionally considered as &quot;web services&quot;.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;WCF &quot;web services&quot; are part of a much broader spectrum of remote communication enabled through WCF. You will get a much higher degree of flexibility and portability doing things in WCF than through traditional ASMX because WCF is designed, from the ground up, to summarize all of the different distributed programming infrastructures offered by Microsoft. An endpoint in WCF can be communicated with just as easily over SOAP/XML as it can over TCP/binary and to change this medium is simply a configuration file mod. In theory, this reduces the amount of new code needed when porting or changing business needs, targets, etc.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;ASMX is older than WCF, and anything ASMX can do so can WCF (and more). Basically you can see WCF as trying to logically group together all the different ways of getting two apps to communicate in the world of Microsoft; ASMX was just one of these many ways and so is now grouped under the WCF umbrella of capabilities.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;Web Services can be accessed only over HTTP &amp;amp; it works in stateless environment, where WCF is flexible because its services can be hosted in different types of applications. Common scenarios for hosting WCF services are IIS,WAS, Self-hosting, Managed Windows Service.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;The major difference is that Web Services Use&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;XmlSerializer&lt;/code&gt;. But WCF Uses&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;DataContractSerializer&amp;nbsp;&lt;/code&gt;which is better in Performance as compared to&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;XmlSerializer&lt;/code&gt;.&lt;/div&gt;&lt;h4 style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;Key issues with XmlSerializer to serialize .NET types to XML&lt;/h4&gt;&lt;ul style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot; type=&quot;disc&quot;&gt;&lt;li style=&quot;font-size: 10pt;&quot;&gt;Only&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;Public&amp;nbsp;&lt;/code&gt;fields or Properties of .NET types can be translated into XML&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;Only the classes which implement&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;IEnumerable&amp;nbsp;&lt;/code&gt;interface&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;Classes that implement the&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;IDictionary&amp;nbsp;&lt;/code&gt;interface, such as Hash table cannot be serialized&lt;/li&gt;
&lt;/ul&gt;&lt;h4 style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;Important difference between DataContractSerializer and XMLSerializer&lt;/h4&gt;&lt;ul style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot; type=&quot;disc&quot;&gt;&lt;li style=&quot;font-size: 10pt;&quot;&gt;A practical benefit of the design of the&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;DataContractSerializer&amp;nbsp;&lt;/code&gt;is better performance over&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;Xmlserializer&lt;/code&gt;.&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;XML Serialization does not indicate which fields or properties of the type are serialized into XML whereas&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;DataCotractSerializer&lt;/code&gt;&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;&lt;/code&gt;Explicitly shows the which fields or properties are serialized into XML&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;The&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;DataContractSerializer&amp;nbsp;&lt;/code&gt;can translate the&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;HashTable&amp;nbsp;&lt;/code&gt;into XML&lt;/li&gt;
&lt;/ul&gt;&lt;h2 style=&quot;background-color: white; color: #ff9900; font-family: Verdana, Arial, sans-serif; font-size: 13pt; text-align: -webkit-auto;&quot;&gt;&lt;a href=&quot;http://www.tech-guruji.com/wordpress/wp-content/uploads/2010/12/tech-guruji-WCF-features.png&quot; style=&quot;color: purple; text-decoration: none;&quot;&gt;&lt;/a&gt;Using the Code&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;The development of web service with ASP.NET relies on defining data and relies on the XmlSerializer to transform data to or from a service.&lt;/div&gt;&lt;h4 style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;Key issues with XmlSerializer to serialize .NET types to XML&lt;/h4&gt;&lt;ul style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot; type=&quot;disc&quot;&gt;&lt;li style=&quot;font-size: 10pt;&quot;&gt;Only&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;Public&lt;/code&gt;&amp;nbsp;fields or Properties of .NET types can be translated into XML&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;Only the classes which implement&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.collections.ienumerable.aspx&quot; style=&quot;color: purple; text-decoration: none;&quot;&gt;IEnumerable&lt;/a&gt;&amp;nbsp;interface&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;Classes that implement the&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.collections.idictionary.aspx&quot; style=&quot;color: purple; text-decoration: none;&quot;&gt;IDictionary&lt;/a&gt;&amp;nbsp;interface, such as Hash table cannot be serialized&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;The WCF uses the&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;DataContractAttribute&amp;nbsp;&lt;/code&gt;and&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;DataMemeberAttribute&amp;nbsp;&lt;/code&gt;to translate .NET FW types into XML.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: white; text-align: -webkit-auto;&quot;&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: x-small;&quot;&gt;[DataContract]&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: x-small;&quot;&gt;public class Item&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: x-small;&quot;&gt;{&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; [DataMember]&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; public string ItemID;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; [DataMember]&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; public decimal ItemQuantity;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; [DataMember]&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; public decimal ItemPrice;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px;&quot;&gt;The&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;DataContractAttribute&amp;nbsp;&lt;/code&gt;can be applied to the class or a strcture.&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;DataMemberAttribute&amp;nbsp;&lt;/code&gt;can be applied to field or a property and theses fields or properties can be either&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;public&amp;nbsp;&lt;/code&gt;or&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;private&lt;/code&gt;.&lt;/div&gt;&lt;div style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px;&quot;&gt;Important difference between&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;DataContractSerializer&amp;nbsp;&lt;/code&gt;and&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;XMLSerializer&lt;/code&gt;.&lt;/div&gt;&lt;ul style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px;&quot; type=&quot;disc&quot;&gt;&lt;li style=&quot;font-size: 10pt;&quot;&gt;A practical benefit of the design of the&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;DataContractSerializer&amp;nbsp;&lt;/code&gt;is better performance over XML serialization.&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;XML Serialization does not indicate which fields or properties of the type are serialized into XML whereas&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;DataContractSerializer&amp;nbsp;&lt;/code&gt;explicitly shows which fields or properties are serialized into XML.&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;The&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;DataContractSerializer&amp;nbsp;&lt;/code&gt;can translate the&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;HashTable&amp;nbsp;&lt;/code&gt;into XML.&lt;/li&gt;
&lt;/ul&gt;&lt;h4 style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px;&quot;&gt;Developing Service&lt;/h4&gt;&lt;div style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px;&quot;&gt;To develop a service using ASP.NET, we must add the&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;WebService&amp;nbsp;&lt;/code&gt;attribute to the class and&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;WebMethodAttribute&amp;nbsp;&lt;/code&gt;to any of the class methods.&lt;/div&gt;&lt;h5 style=&quot;color: #ff9900; font-family: Verdana, Arial, sans-serif; font-size: 9pt; margin-bottom: 2px;&quot;&gt;Example&lt;/h5&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;div&gt;[WebService]&amp;nbsp;&lt;/div&gt;&lt;div&gt;public class Service : System.Web.Services.WebService&amp;nbsp;&lt;/div&gt;&lt;div&gt;{&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; [WebMethod]&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; public string Test(string strMsg)&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; {&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return strMsg;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&amp;nbsp;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;To develop a service in WCF, we will write the following code:&lt;/span&gt; &lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;&lt;div&gt;[ServiceContract]&amp;nbsp;&lt;/div&gt;&lt;div&gt;public interface ITest&amp;nbsp;&lt;/div&gt;&lt;div&gt;{&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[OperationContract]&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string ShowMessage(string strMsg);&amp;nbsp;&lt;/div&gt;&lt;div&gt;}&amp;nbsp;&lt;/div&gt;&lt;div&gt;public class Service : ITest&amp;nbsp;&lt;/div&gt;&lt;div&gt;{&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public string ShowMessage(string strMsg)&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return strMsg;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;The&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;ServiceContractAttribute&amp;nbsp;&lt;/code&gt;specifies that an interface defines a WCF service contract,&lt;br /&gt;
&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;OperationContract&amp;nbsp;&lt;/code&gt;attribute indicates which of the methods of the interface defines the operations of the service contract.&lt;br /&gt;
A class that implements the service contract is referred to as a service type in WCF.&lt;br /&gt;
&lt;h4&gt;Hosting the Service&lt;/h4&gt;ASP.NET web services are compiled into a class library assembly and a service file with an&amp;nbsp;&lt;em&gt;extension .asmx&lt;/em&gt;&amp;nbsp;will have the code for the service. The service file is copied into the root of the ASP.NET application and&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;Assembly&amp;nbsp;&lt;/code&gt;will be copied to the&amp;nbsp;&lt;em&gt;bin&lt;/em&gt;&amp;nbsp;directory. The application is accessible using URL of the service file.&lt;br /&gt;
WCF Service can be hosted within IIS or&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;WindowsActivationService&lt;/code&gt;.&lt;br /&gt;
&lt;ul type=&quot;disc&quot;&gt;&lt;li style=&quot;font-size: 10pt;&quot;&gt;Compile the service type into a class library&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;Copy the service file with an extension&amp;nbsp;&lt;em&gt;.SVC&lt;/em&gt;&amp;nbsp;into a virtual directory and assembly into&amp;nbsp;&lt;em&gt;bin&lt;/em&gt;&amp;nbsp;sub directory of the virtual directory.&lt;/li&gt;
&lt;li style=&quot;font-size: 10pt;&quot;&gt;Copy the&amp;nbsp;&lt;em&gt;web.config&lt;/em&gt;&amp;nbsp;file into the virtual directory.&lt;/li&gt;
&lt;/ul&gt;&lt;h4&gt;Client Development&lt;/h4&gt;Clients for the ASP.NET Web services are generated using the command-line tool&amp;nbsp;&lt;em&gt;WSDL.EXE&lt;/em&gt;.&lt;br /&gt;
WCF uses the&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;ServiceMetadata&amp;nbsp;&lt;/code&gt;tool (&lt;em&gt;svcutil.exe&lt;/em&gt;) to generate the client for the service.&lt;br /&gt;
&lt;h4&gt;Message Representation&lt;/h4&gt;The Header of the SOAP Message can be customized in ASP.NET Web service.&lt;br /&gt;
WCF provides attributes&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;MessageContractAttribute&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;MessageHeaderAttribute&amp;nbsp;&lt;/code&gt;and&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;MessageBodyMemberAttribute&amp;nbsp;&lt;/code&gt;to describe the structure of the SOAP Message.&lt;br /&gt;
&lt;h4&gt;Service Description&lt;/h4&gt;Issuing a HTTP&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;GET&amp;nbsp;&lt;/code&gt;Request with query WSDL causes ASP.NET to generate WSDL to describe the service. It returns the WSDL as a response to the request.&lt;br /&gt;
The generated WSDL can be customized by deriving the class of&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;ServiceDescriptionFormatExtension&lt;/code&gt;.&lt;br /&gt;
Issuing a Request with the query WSDL for the&amp;nbsp;&lt;em&gt;.svc&lt;/em&gt;&amp;nbsp;file generates the WSDL. The WSDL that generated by WCF can be customized by using&amp;nbsp;&lt;code style=&quot;color: #990000; font-family: &#39;Courier New&#39;, Courier, mono; font-size: 11pt;&quot;&gt;ServiceMetadataBehavior&amp;nbsp;&lt;/code&gt;class.&lt;br /&gt;
&lt;h4&gt;Exception Handling&lt;/h4&gt;In ASP.NET Web services, unhandled exceptions are returned to the client as SOAP faults.&lt;br /&gt;
In WCF Services, unhandled exceptions are not returned to clients as SOAP faults. A configuration setting is provided to have the unhandled exceptions returned to clients for the purpose of debugging.&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/759555455759653294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/759555455759653294' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/759555455759653294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/759555455759653294'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2012/07/whats-difference-between-wcf-and-web.html' title='What&#39;s the Difference between WCF and Web Services?'/><author><name>TechWorld</name><uri>http://www.blogger.com/profile/09856708671275822378</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-8150196914847702654</id><published>2012-06-06T14:50:00.001+05:30</published><updated>2012-06-15T14:07:33.000+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# interview question..."/><title type='text'>Few important C# question...</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;1.&lt;b style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana, Tahoma, Arial, sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write?&lt;/b&gt;&lt;span style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana,Tahoma,Arial,sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana,Tahoma,Arial,sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;Ans. &amp;nbsp;Two. Once you write at least one constructor, C# cancels the freebie constructor, and now you have to write one yourself, even if there’s no implementation in it.&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana,Tahoma,Arial,sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana,Tahoma,Arial,sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;2.&lt;/span&gt;&lt;b style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana, Tahoma, Arial, sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;Can you declare the override method static while the original method is non-static?&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana,Tahoma,Arial,sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;&amp;nbsp;Ans. No, you can’t, the signature of the virtual method must remain the same, only the keyword virtual is changed to keyword override.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana,Tahoma,Arial,sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana,Tahoma,Arial,sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;3.&lt;/span&gt;&lt;b style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana, Tahoma, Arial, sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;Can you prevent your class from being inherited and becoming a base class for some other classes?&lt;/b&gt;&lt;span style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana,Tahoma,Arial,sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;&amp;nbsp;Ans. Yes, that’s what keyword sealed in the class definition is for. The developer trying to derive from your class will get a message: cannot inherit from Sealed class Whatever Base Class Name is.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana,Tahoma,Arial,sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana,Tahoma,Arial,sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;4.&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana, Tahoma, Arial, sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;When do you absolutely have to declare a class as abstract (as opposed to free-willed educated choice or decision based on UML diagram)?&lt;/b&gt;&lt;span style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana,Tahoma,Arial,sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana,Tahoma,Arial,sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;Ans. When at least one of the methods in the class is abstract. When the class itself is inherited from an abstract class, but not all base abstract methods have been over-ridden.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana,Tahoma,Arial,sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana,Tahoma,Arial,sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;5.&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana, Tahoma, Arial, sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;What’s the difference between System.String and System.StringBuilder classes?&lt;/b&gt;&lt;br /&gt;
&lt;b style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana, Tahoma, Arial, sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;Ans.&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana,Tahoma,Arial,sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;System.String is immutable; System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana,Tahoma,Arial,sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: Verdana,Tahoma,Arial,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 11px; line-height: 16px;&quot;&gt;6.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;What is the use of private constructor ?&lt;br /&gt;
Ans.&amp;nbsp;&lt;span style=&quot;font-family: Verdana,Arial,Tahoma; font-size: 13px; text-align: justify;&quot;&gt;When we declare a class constructor as private , we can not do 2 things:-&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;font-family: Verdana, Arial, Tahoma; font-size: 13px; text-align: justify;&quot;&gt;&lt;li&gt;We can not create a object of the class.&lt;/li&gt;
&lt;li&gt;We can not inherit the class.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: Verdana, Arial, Tahoma; font-size: 13px; text-align: justify;&quot;&gt;Now the next question which the interviewer will ask , whats the use of such kind of class which can not be inherited neither instantiated.&lt;/div&gt;&lt;div style=&quot;font-family: Verdana, Arial, Tahoma; font-size: 13px; text-align: justify;&quot;&gt;Many times we do not want to create instances of certain classes like utility , common routine classes. Rather than calling as shown below&lt;/div&gt;&lt;div style=&quot;font-family: Verdana, Arial, Tahoma; font-size: 13px; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Verdana, Arial, Tahoma; font-size: 13px; text-align: justify;&quot;&gt;7.&lt;span style=&quot;text-align: left;&quot;&gt;Who is faster hashtable or dictionary ?&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana, Arial, Tahoma; font-size: 13px; text-align: justify;&quot;&gt;&lt;span style=&quot;text-align: left;&quot;&gt;Ans.&lt;/span&gt;&lt;span style=&quot;color: #000099;&quot;&gt;Dictionary is faster than hashtable as dictionary is a generic strong type. Hashtable is slower as it takes object as data type which leads to boxing and unboxing.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana, Arial, Tahoma; font-size: 13px; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #000099;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana, Arial, Tahoma; font-size: 13px; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #000099;&quot;&gt;8.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-align: left;&quot;&gt;What is the difference between const and readonly?&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana, Arial, Tahoma; font-size: 13px; text-align: justify;&quot;&gt;&lt;span style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana, Arial, Tahoma; font-size: 13px; text-align: justify;&quot;&gt;&lt;span style=&quot;text-align: left;&quot;&gt;Ans.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana, Arial, Tahoma; font-size: 13px; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;pre class=&quot;lang-cs prettyprint&quot; style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 18px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; text-align: left; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px none; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px none; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; border: 0px none; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Const_V_Readonly&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px none; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px none; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px none; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; I_CONST_VALUE &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;background-color: transparent; border: 0px none; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px none; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px none; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;readonly&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px none; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; I_RO_VALUE&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px none; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; border: 0px none; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Const_V_Readonly&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;I_RO_VALUE &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;background-color: transparent; border: 0px none; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px none; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; text-align: left; vertical-align: baseline; word-wrap: break-word;&quot;&gt;AssemblyB references AssemblyA and uses these values in code. When this is compiled,&lt;/div&gt;&lt;ul style=&quot;background-color: white; border: 0px; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1em 30px; padding: 0px; text-align: left; vertical-align: baseline;&quot;&gt;&lt;li style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;in the case of the const value, it is like a find-replace, the value 2 is &#39;baked into&#39; the AssemblyB&#39;s IL. This means that tomorrow if I update I_CONST_VALUE to 20 in the future.&amp;nbsp;&lt;i style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Assembly B would still have 2 till I recompile it&lt;/i&gt;.&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;in the case of the readonly value, it is like a ref to a memory location. The value is not baked into AssemblyB&#39;s IL. This means that if the memory location is updated, Assembly B gets the new value without recompilation. So if I_RO_VALUE is updated to 30, you only need to build AssemblyA. All clients do not need to be recompiled.&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 18px;&quot;&gt;9.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;I want to force the data reader to return only schema of the data store rather than data.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;Ans.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 13px;&quot;&gt;PobjDataReader = pobjCommand.ExecuteReader (CommandBehavior.SchemaOnly)&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana,Tahoma,Arial,sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana,Tahoma,Arial,sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;10.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 11pt;&quot;&gt;What are the various methods provided by the dataset object to generate XML?&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fafcff; color: #2a2a2a; font-family: Verdana,Tahoma,Arial,sans-serif; font-size: 11px; line-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;&amp;nbsp;XML is one of the most important leap between classic ADO and ADO.NET. So this question is normally asked more generally how can we convert any data to XML format. Best answer is convert in to dataset and use the below methods.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;• ReadXML&lt;br /&gt;
Read’s a XML document in to Dataset.&lt;br /&gt;
• GetXML&lt;br /&gt;
This is a function, which returns the string containing XML document.&lt;br /&gt;
• Writexml&lt;br /&gt;
This writes a XML data to disk.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;11.&lt;span style=&quot;font-size: 11pt;&quot;&gt;What is the difference between “Dataset” and “Data Reader” ?&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;Ans.&lt;/span&gt;Following are the major differences between “Dataset” and “Data Reader”:-&lt;/div&gt;&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 13px;&quot;&gt;• “Dataset” is a disconnected architecture, while “Data Reader” has live connection while reading data. If we want to cache data and pass to a different tier “Dataset” forms the best choice and it has decent XML support.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 13px;&quot;&gt;• When application needs to access data from more than one table “Dataset” forms the best choice.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 13px;&quot;&gt;• If we need to move back while reading records, “data reader” does not support this functionality.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 13px;&quot;&gt;• However, one of the biggest drawbacks of Dataset is speed. As “Dataset” carry considerable overhead because of relations, multiple table’s etc speed is slower than “Data Reader”. Always try to use “Data Reader” wherever possible, as it is meant especially for speed performance.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 13px;&quot;&gt;12.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 11pt;&quot;&gt;What’s difference between “Optimistic” and “Pessimistic” locking ?&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 11pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 13px;&quot;&gt;In pessimistic locking when user wants to update data it locks the record and till then no one can update data. Other user’s can only view the data when there is pessimistic locking.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 13px;&quot;&gt;In optimistic locking multiple users can open the same record for updating, thus increase maximum concurrency. Record is only locked when updating the record. This is the most preferred way of locking practically. Now a days in browser based application it is very common and having pessimistic locking is not a practical solution.&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 13px;&quot;&gt;13.&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 11pt;&quot;&gt;How many ways are there to implement locking in ADO.NET?&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 11pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 13px;&quot;&gt;Following are the ways to implement locking using ADO.NET:-&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 13px;&quot;&gt;• When we call “Update” method of Data Adapter it handles locking internally. If the Dataset values are not matching with current data in Database, it raises concurrency exception error. We can easily trap this error using Try. Catch block and raise appropriate error message to the user.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 13px;&quot;&gt;• Define a Date time stamp field in the table. When actually you are firing the UPDATE SQL statements, compare the current timestamp with one existing in the database. Below is a sample SQL which checks for timestamp before updating and any mismatch in timestamp it will not update the records. This I the best practice used by industries for locking.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;Update table1 set field1=@test where Last Timestamp=@Current Timestamp&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 13px;&quot;&gt;• Check for original values stored in SQL SERVER and actual changed values. In stored procedure check before updating that the old data is same as the current Example in the below shown SQL before updating field1 we check that is the old field1 value same. If not then some one else has updated and necessary action has to be taken.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;Update table1 set field1=@test where field1 = @oldfield1value&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 13px;&quot;&gt;Locking can be handled at ADO.NET side or at SQL SERVER side i.e. in stored procedures. For more details of how to implementing locking in SQL SERVER read “What are different locks in SQL SERVER?” in SQL SERVER chapter.&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana,Arial,sans-serif; font-size: 13px;&quot;&gt;14.&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #ff9900; font-family: Verdana,Arial,sans-serif; font-size: 11pt;&quot;&gt;How can we perform transactions in .NET?&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #ff9900; font-family: Verdana,Arial,sans-serif; font-size: 11pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;The most common sequence of steps that would be performed while developing a transactional application is as follows:&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;• Open a database connection using the Open method of the connection object.&lt;br /&gt;
• Begin a transaction using the Begin Transaction method of the connection object. This method provides us with a transaction object that we will use later to commit or rollback the transaction. Note that changes caused by any queries executed before calling the Begin Transaction method will be committed to the database immediately after they execute. Set the Transaction property of the command object to the above mentioned transaction object.&lt;br /&gt;
• Execute the SQL commands using the command object. We may use oneormorecommand objects for this purpose, as long as the Transaction property of all the objects is set to a valid transaction object.&lt;br /&gt;
• Commit or roll back the transaction using the Commit or Rollback method of the transaction object.&lt;br /&gt;
• Close the database connection.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;15.&lt;span style=&quot;color: #ff9900; font-size: 11pt;&quot;&gt;What is difference between Dataset? Clone and Dataset. Copy?&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;color: #ff9900; font-size: 11pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;Clone: - It only copies structure, does not copy data.&lt;br /&gt;
Copy: - Copies both structure and data. &lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;16.&amp;nbsp;&lt;span style=&quot;color: #ff9900; font-size: 11pt;&quot;&gt;What is Maximum Pool Size in ADO.NET Connection String?&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;color: #ff9900; font-size: 11pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;Maximum pool size decides the maximum number of connection objects to be pooled. If the maximum pool size is reached and there is no usable connection available the request is queued until connections are released back in to pool. So it’s always a good habit to call the close or dispose method of the connection as soon as you have finished work with the connection object. &lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;17.&amp;nbsp;&lt;span style=&quot;color: #ff9900; font-size: 11pt;&quot;&gt;How to enable and disable connection pooling?&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;For .NET it is enabled by default but if you want to just make sure set Pooling=true in the connection string. To disable connection pooling set Pooling=false in connection string if it is an ADO.NET Connection. If it is an OLEDBConnection object set OLE DB Services=-4 in the connection string. &lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Verdana, Arial, sans-serif; font-size: 13px; text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;color: #ff9900; font-size: 11pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/8150196914847702654/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/8150196914847702654' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/8150196914847702654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/8150196914847702654'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2012/06/c-interview-question.html' title='Few important C# question...'/><author><name>TechWorld</name><uri>http://www.blogger.com/profile/09856708671275822378</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-6517786583126910562</id><published>2012-06-05T15:16:00.001+05:30</published><updated>2012-06-05T15:17:26.628+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="CROSS Apply and OUTER Apply"/><title type='text'>APPLY operator (CROSS Apply and OUTER Apply) in SQL Server</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;The &lt;b&gt;APPLY &lt;/b&gt;operator let&#39;s you join a table to a table-valued-function.UDFs can be used in queries at column level, table levels and on column definition while creating tables.&lt;br /&gt;
They can also be joined with other tables, but not by simple joins. They have special joins called &lt;b&gt;APPLY &lt;/b&gt;operator.There are 2 types of APPLY:&lt;br /&gt;
&lt;b&gt;- CROSS APPLY&lt;/b&gt; acts as INNER JOIN, returns only rows from the outer table that produce a result set from the table-valued function.&lt;br /&gt;
&lt;b&gt;- OUTER APPLY&lt;/b&gt; acts as OUTER JOIN, returns both rows  that produce a result set, and rows that do not, with NULL values in the  columns produced by the table-valued function.&lt;br /&gt;
&amp;nbsp;eg:&lt;br /&gt;
CREATE Procedure [dbo].[Test_Apply]&lt;br /&gt;
(&lt;br /&gt;
&amp;nbsp;ContactId varchar(50)&lt;br /&gt;
)&lt;br /&gt;
As&lt;br /&gt;
BEGIN &lt;br /&gt;
SELECT name.Customer_Id,name.CustomerName,name.Email,name.MobileNo&lt;br /&gt;
,name.EntryDate,name.ProductID,name.Product&lt;br /&gt;
FROM Test_Lead lead&lt;br /&gt;
INNER JOIN customer cust ON cust.CustomerId = lead.CustomerID&lt;br /&gt;
outer apply dbo.fn_Test_GetLatestResponse_Customerwise(lead.Customer_ID) sales &lt;br /&gt;
cross apply dbo.fn_Test_GetCustomerDetails(lead.Customer_ID) name&lt;br /&gt;
inner join LMS_UserDetails agent on agent.ID = lead.Allocated_To&lt;br /&gt;
WHERE lead.ProductId = name.ProductID &lt;br /&gt;
END&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/6517786583126910562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/6517786583126910562' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/6517786583126910562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/6517786583126910562'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2012/06/apply-operator-cross-apply-and-outer.html' title='APPLY operator (CROSS Apply and OUTER Apply) in SQL Server'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-524458770906106817</id><published>2012-06-04T19:07:00.000+05:30</published><updated>2012-06-04T19:07:23.213+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Generics in C#"/><title type='text'>Generics in C#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;Parametric Polymorphism is a well-established programming language feature. Generics offers this feature to C#. &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;The  best way to understand generics is to study some C# code that would  benefit from generics. The code stated below is about a simple Stack  class with two methods: Push () and Pop (). First, without using  generics example you can get a clear idea about two issues: a) Boxing  and unboxing overhead and b) No strong type information at compile type.  After that the same Stack class with the use of generics explains how  these two issues are solved.&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;&lt;strong&gt;Example Code&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;&lt;strong&gt;Code without using generics:&lt;/strong&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; Stack&lt;br /&gt;
{&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;object&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;[] store; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; size; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; Push(&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;object&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; x) {...} &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;object&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; Pop() {...}&lt;br /&gt;
} &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;&lt;strong&gt;Boxing and unboxing overhead:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;You  can push a value of any type onto a stack. To retrieve, the result of  the Pop method must be explicitly cast back. For example if an integer  passed to the Push method, it is automatically boxed. While retrieving,  it must be unboxed with an explicit type cast. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Stack stack = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; Stack();&lt;br /&gt;
stack.Push(3);&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; i = (&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;)stack.Pop(); &lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;//unboxing with explicit int casting &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;Such  boxing and unboxing operations add performance overhead since they  involve dynamic memory allocations and run-time type checks. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;&lt;strong&gt;No strong Type information at Compile Time&lt;/strong&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;Another  issue with the Stack class: It is not possible to enforce the kind of  data placed on a stack. For example, a string can be pushed on a stack  and then accidentally cast to the wrong type like integer after it is  retrieved: &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Stack stack = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; Stack();&lt;br /&gt;
stack.Push(&quot;SomeName&quot;); &lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;//pushing the string&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; i = (&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;)stack.Pop(); &lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;//run-time exception will be thrown at this point&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;The  above code is technically correct and you will not get any compile time  error. The problem does not become visible until the code is executed;  at that point an InvalidCastException is thrown. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;&lt;strong&gt;Code with generics&lt;/strong&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;In  C# with generics, you declare class Stack &amp;lt;T&amp;gt; {...}, where T is  the type parameter. Within class Stack &amp;lt;T&amp;gt; you can use T as if it  were a type. You can create a Stack as Integer by declaring Stack  &amp;lt;int&amp;gt; or Stack as Customer object by declaring  Stack&amp;lt;Customer&amp;gt;. Simply your type arguments get substituted for  the type parameter. All of the Ts become ints or Customers, you don&#39;t  have to downcast, and there is strong type checking everywhere. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; Stack&amp;lt;T&amp;gt;&lt;br /&gt;
{ &lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;// items are of type T, which is kown when you create the object&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;T[] items; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; count; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; Push(T item) {...}&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;//type of method pop will be decided when you creat the object &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; T Pop() &lt;br /&gt;
{...} &lt;br /&gt;
} &lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;In the following example, int is given as the type argument for T: &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Stack&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt; stack = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; Stack&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;();&lt;br /&gt;
stack.Push(3);&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; i = stack.Pop(); &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;The  Stack&amp;lt;int&amp;gt; type is called a constructed type. In the  Stack&amp;lt;int&amp;gt; type, every occurrence of T is replaced with the type  argument int. The Push and Pop methods of a Stack&amp;lt;int&amp;gt; operate on  int values, making it a compile-time error to push values of other types  onto the stack, and eliminating the need to explicitly cast values back  to their original type when they are retrieved. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;You can use parameterization not only for classes but also for interfaces, structs, methods and delegates.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;//For Interfaces &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;interface&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; IComparable &amp;lt;T&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;//for structs &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;struct&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; HashBucket &amp;lt;K,D&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;//for methods &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; Reverse &amp;lt;T&amp;gt; (T[] arr)&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;//for delegates &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;delegate&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; Action &amp;lt;T&amp;gt; (T arg)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;&lt;strong&gt;What you can get with Generics&lt;/strong&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;Generics can make the C# code more efficient, type-safe and maintainable.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;&lt;strong&gt;Efficiency&lt;/strong&gt;: Following points states that how performance is boosted. &lt;/span&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;Instantiations  of parameterized classes are loaded dynamically and the code for their  methods is generated on demand [Just in Time]. &lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;Where ever possible, compiled code and data representations are shared between different instantiations. &lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;Due to type specialization, the implementation never needs to box values of primitive types. &lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;&lt;strong&gt;Safety&lt;/strong&gt;: Strong type checking at compile time, hence more bugs caught at compile time itself. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;&lt;strong&gt;Maintainability&lt;/strong&gt;:  Maintainability is achieved with fewer explicit conversions between  data types and code with generics improves clarity and expressively.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;Generics  gives better performance, type safety and clarity to the C# programs.  Generics will increase program reliability by adding strong type  checking. Learning how to use generics is straightforward, hopefully  this article has inspired you to look deeper into how you can use them.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/524458770906106817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/524458770906106817' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/524458770906106817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/524458770906106817'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2012/06/generics-in-c.html' title='Generics in C#'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-9088367163022285508</id><published>2012-06-04T18:04:00.000+05:30</published><updated>2012-06-04T18:04:05.615+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Schemabinding View"/><title type='text'>Schemabinding View</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Schemabinding View Restirct you to made any change in tables you used in your View. &lt;br /&gt;
Example: &lt;br /&gt;
&lt;br /&gt;
Suppose I have an table Employee(EmpID,EmpName, DOJ,Managerid,DepartID) &lt;br /&gt;
&lt;br /&gt;
Now am Creating a view &lt;br /&gt;
&lt;br /&gt;
Create View EmployeeDetails &lt;br /&gt;
with Schemabinding &lt;br /&gt;
as &lt;br /&gt;
Select EmPid, EmpName,DOj,ManagerId,DepartID from Employee &lt;br /&gt;
&lt;br /&gt;
after it just try to execute delete table and alter table and delete column of employee table. &lt;br /&gt;
&lt;br /&gt;
Sql server will not allow to change table schema. Because you are  having Schema dependency.First you need to delete View then only  database will allow to modify table. &lt;br /&gt;
&lt;br /&gt;
If you are using Normal View. Sytem will Allow you to delete or  modify table but when you run your View next time it will display error.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/9088367163022285508/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/9088367163022285508' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/9088367163022285508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/9088367163022285508'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2012/06/schemabinding-view.html' title='Schemabinding View'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-4375160140041457898</id><published>2012-06-04T15:48:00.000+05:30</published><updated>2012-06-04T15:48:16.760+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Chain constructor or constructor chaining"/><title type='text'>Chain constructor or constructor chaining</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;We can chain the call of constructor from child class to base class  depending on our requirement. This concept makes sure that the matching  base class constructor must be called based on the parameter passed to  the child class constructor. &lt;br /&gt;
&lt;br /&gt;
Example: &lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;namespace ConsoleApplication1

{

    class A

    {

        public A(){

            Console.WriteLine(&quot;Constructor A.&quot;);

        }

        public A(string s){

            Console.WriteLine(&quot;Constructor A with parameter = {0}&quot;,s);

        }

        public A(string s,string t){

            Console.WriteLine(&quot;Constructor A with parameter = {0} &amp;amp; {1}&quot;, s,t);

        }

    }



    class B:A

    {

        public B():base(){

            Console.WriteLine(&quot;Constructor B.&quot;);

        }

        public B(string s):base(s){

            Console.WriteLine(&quot;Constructor B with parameter = {0}&quot;, s);

        }

        public B(string s, string t):base(s,t){

            Console.WriteLine(&quot;Constructor B with parameter = {0} &amp;amp; {1}&quot;, s, t);

        }

    }

    class Program

    {

        static void Main(string[] args)

        {

            B b1 = new B();

            B b2 = new B(&quot;First Parameter &quot;, &quot;Second Parameter&quot;);



            Console.Read();

        }

    }

}&lt;/pre&gt;&lt;br /&gt;
Output: &lt;br /&gt;
Constructor A. &lt;br /&gt;
Constructor B. &lt;br /&gt;
Constructor A with parameter = First Parameter  &amp;amp; Second Parameter &lt;br /&gt;
Constructor B with parameter = First Parameter  &amp;amp; Second Parameter&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/4375160140041457898/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/4375160140041457898' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/4375160140041457898'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/4375160140041457898'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2012/06/chain-constructor-or-constructor.html' title='Chain constructor or constructor chaining'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-9078768515742631324</id><published>2012-06-04T15:43:00.000+05:30</published><updated>2012-06-04T15:43:47.931+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Difference between Abstraction and Encapsulation????"/><title type='text'>Difference between Abstraction and Encapsulation????</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;background-color: white; border-collapse: collapse; border: none; color: black; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 25px; margin: 0px; outline: 0px; padding: 0px; text-align: left;&quot;&gt;&lt;tbody style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border: 1pt solid windowtext; margin: 0px; outline: 0px; padding: 0in 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px; text-align: center;&quot;&gt;&lt;b style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;span lang=&quot;EN-IN&quot; style=&quot;border: 0px; font-family: Verdana, sans-serif; font-size: 14pt; line-height: 21px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;Abstraction&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;border: 1pt solid windowtext; margin: 0px; outline: 0px; padding: 0in 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px; text-align: center;&quot;&gt;&lt;b style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;span lang=&quot;EN-IN&quot; style=&quot;border: 0px; font-family: Verdana, sans-serif; font-size: 14pt; line-height: 21px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;Encapsulation&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border: 1pt solid windowtext; margin: 0px; outline: 0px; padding: 0in 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;span lang=&quot;EN-IN&quot; style=&quot;border: 0px; font-family: Verdana, sans-serif; font-size: 12pt; line-height: 18px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;1. Abstraction solves the problem in the design level.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; margin: 0px; outline: 0px; padding: 0in 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;span lang=&quot;EN-IN&quot; style=&quot;border: 0px; font-family: Verdana, sans-serif; font-size: 12pt; line-height: 18px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;1. Encapsulation solves the problem in the implementation level.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border: 1pt solid windowtext; margin: 0px; outline: 0px; padding: 0in 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;span lang=&quot;EN-IN&quot; style=&quot;border: 0px; font-family: Verdana, sans-serif; font-size: 12pt; line-height: 18px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;2. Abstraction is used for hiding the unwanted data and giving relevant data.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; margin: 0px; outline: 0px; padding: 0in 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;span lang=&quot;EN-IN&quot; style=&quot;border: 0px; font-family: Verdana, sans-serif; font-size: 12pt; line-height: 18px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;2. Encapsulation means hiding the code and data into a single unit to protect the data from outside world.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border: 1pt solid windowtext; margin: 0px; outline: 0px; padding: 0in 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;span lang=&quot;EN-IN&quot; style=&quot;border: 0px; font-family: Verdana, sans-serif; font-size: 12pt; line-height: 18px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;3. Abstraction lets you focus on what the object does instead of how it does it&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; margin: 0px; outline: 0px; padding: 0in 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;span lang=&quot;EN-IN&quot; style=&quot;border: 0px; font-family: Verdana, sans-serif; font-size: 12pt; line-height: 18px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;3. Encapsulation means hiding the internal details or mechanics of how an object does something.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border: 1pt solid windowtext; margin: 0px; outline: 0px; padding: 0in 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;span lang=&quot;EN-IN&quot; style=&quot;border: 0px; font-family: Verdana, sans-serif; font-size: 12pt; line-height: 18px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;4.&amp;nbsp;&lt;b style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;Abstraction&lt;/b&gt;- Outer layout, used in terms of design.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;span lang=&quot;EN-IN&quot; style=&quot;border: 0px; font-family: Verdana, sans-serif; font-size: 12pt; line-height: 18px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;For Example:-&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;span lang=&quot;EN-IN&quot; style=&quot;border: 0px; font-family: Verdana, sans-serif; font-size: 12pt; line-height: 18px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&amp;nbsp;Outer Look of a Mobile Phone, like it has a display screen and keypad buttons to dial a number.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; margin: 0px; outline: 0px; padding: 0in 5.4pt; width: 231.05pt;&quot; valign=&quot;top&quot; width=&quot;308&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;span lang=&quot;EN-IN&quot; style=&quot;border: 0px; font-family: Verdana, sans-serif; font-size: 12pt; line-height: 18px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;4.&amp;nbsp;&lt;b style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;Encapsulation&lt;/b&gt;- Inner layout, used in terms of implementation.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;span lang=&quot;EN-IN&quot; style=&quot;border: 0px; font-family: Verdana, sans-serif; font-size: 12pt; line-height: 18px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;For Example:- Inner Implementation detail of a Mobile Phone, how keypad button and Display Screen are connect with each other using circuits.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: 0px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br class=&quot;Apple-interchange-newline&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; border: 0px; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 25px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;span lang=&quot;EN-IN&quot; style=&quot;border: 0px; font-family: Verdana, sans-serif; font-size: 12pt; line-height: 18px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&quot;Encapsulation is accomplished by using Class. - Keeping data and methods that accesses that data into a single unit&quot;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; border: 0px; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 25px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;span lang=&quot;EN-IN&quot; style=&quot;border: 0px; font-family: Verdana, sans-serif; font-size: 12pt; line-height: 18px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&quot;Abstraction is accomplished by using Interface. - Just giving the abstract information about what it can do without specifying the back ground details&quot;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; border: 0px; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 15px; line-height: 25px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;span lang=&quot;EN-IN&quot; style=&quot;border: 0px; font-family: Verdana, sans-serif; font-size: 12pt; line-height: 18px; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&quot;Information/Data hiding is accomplished by using Modifiers - By keeping the instance variables private or protected.&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/9078768515742631324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/9078768515742631324' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/9078768515742631324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/9078768515742631324'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2012/06/difference-between-abstraction-and.html' title='Difference between Abstraction and Encapsulation????'/><author><name>TechWorld</name><uri>http://www.blogger.com/profile/09856708671275822378</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-6646150409546719432</id><published>2012-06-04T12:39:00.002+05:30</published><updated>2012-06-04T12:39:55.947+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Address header in WCF"/><title type='text'>Address header in WCF</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Address Header contains the information which is sent with every request, it can be used by either end point service or any intermediate device for determining any routing logic or processing logic. &lt;br /&gt;
&lt;br /&gt;
WCF provides AddressHeader class for this purpose. &lt;br /&gt;
&lt;br /&gt;
Example : &lt;br /&gt;
&lt;br /&gt;
AddressHeader addressHeader= AddressHeader.CreateAddressHeader(&quot;Name of the header&quot;, &quot;Information included in header &quot;);&lt;br /&gt;
&lt;br /&gt;
Once the AddressHeader instance is created, it can be associated with end point instance as follows : &lt;br /&gt;
&lt;br /&gt;
EndpointAddress endpoint = new EndpointAddress(new Uri(&quot;http://myserver/myservice&quot;), addressHeader);&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/6646150409546719432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/6646150409546719432' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/6646150409546719432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/6646150409546719432'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2012/06/address-header-in-wcf.html' title='Address header in WCF'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-4445727350432709171</id><published>2012-06-04T12:35:00.000+05:30</published><updated>2012-06-04T12:35:26.764+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Isolation levels"/><title type='text'>Isolation levels in Sql Server</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;An isolation levels mechanism is used to isolate a resource each transaction in a multi-user &lt;br /&gt;
environment. Isolation can be set by obtaining locks on objects.&amp;nbsp; The correct use of the isolation levels mechanism prevents applications from introducing errors that can occur from the following situations. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1. Lost Updates:&lt;/b&gt; This situation occurs when two transactions attempt to update the same data. Consider the following example:&lt;br /&gt;
Transaction A reads row 1.&lt;br /&gt;
Transaction B reads row 1.&lt;br /&gt;
Transaction A updates row 1.&lt;br /&gt;
Transaction B updates row 1, overlaying changes applied by Transaction A.&lt;br /&gt;
&lt;br /&gt;
In the above situation, updates performed by Transaction A are lost.&lt;br /&gt;
&lt;br /&gt;
This problem could be avoided if the second Transaction could not make changes until the first Transaction had finished.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;2. Dirty Reads:&lt;/b&gt; This situation occurs when transactions read data that has not been committed. Consider the following example:&lt;br /&gt;
Transaction A inserts row 1 without committing.&lt;br /&gt;
Transaction B reads row 1.&lt;br /&gt;
Transaction A rolls back row 1.&lt;br /&gt;
Transaction B now has a row that physically does not exist.&lt;br /&gt;
&lt;br /&gt;
This problem could be avoided if no one could read the changes until the first Transaction determined that the changes were final.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;3. Nonrepeatable Reads:&lt;/b&gt; This situation occurs when a transaction reads the same query multiple times and results are not the same each time. Consider the following example:&lt;br /&gt;
Transaction A reads a row of data.&lt;br /&gt;
Transaction B modifies this row and commits.&lt;br /&gt;
Transaction A re-reads the same row and sets back different data values.&amp;nbsp; (When the record was read for the second time by Transaction A, it has changed).&lt;br /&gt;
&lt;br /&gt;
This problem could be avoided if the Transaction A could read the row only after the Transaction B has finished writing it.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;4. Phantom reads:&lt;/b&gt; This situation occurs when a row of data matches the first time but does not match subsequent times. Consider the following example:&lt;br /&gt;
Transaction A reads two rows based on a Query A where clause.&lt;br /&gt;
Transaction B inserts a new row that happens to fall under Transaction A Query A&#39;s where clause.&lt;br /&gt;
Transaction A runs Query A again and now gets back three rows.&lt;br /&gt;
&lt;br /&gt;
Example2:&lt;br /&gt;
&lt;br /&gt;
Phantom reads occur when an insert or delete action is performed against a row that belongs to a range of rows being read by a transaction. The transaction&#39;s first read of the range of rows shows a row that no longer exists in the second or succeeding read, as a result of a deletion by a different transaction. Similarly, as the result of an insert by a different transaction, the transaction&#39;s second or succeeding read shows a row that did not exist in the original read.&lt;br /&gt;
&lt;br /&gt;
The above four phenomenon demonstrate that there is a need to utilize a mechanism called ISOLATION LEVELS.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/4445727350432709171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/4445727350432709171' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/4445727350432709171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/4445727350432709171'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2012/06/isolation-levels-in-sql-server.html' title='Isolation levels in Sql Server'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-6272839457315679970</id><published>2012-06-04T12:32:00.000+05:30</published><updated>2012-06-04T12:32:01.953+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="event and delegate"/><title type='text'>Difference between event and delegate</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Class1 c = new Class1();&lt;br /&gt;
c.MyDeleageteCallback = new Class1.DomSomethingDelegate(this.Calculate);&lt;br /&gt;
&lt;br /&gt;
This piece of code will work just fine with class1, but if we were to try to use it on class2, where there is the event keyword declared, we would get a compilation error.&lt;br /&gt;
&lt;br /&gt;
In conclusion: an event declaration adds a layer of protection on the delegate instance. This protection prevents clients of the delegate from resetting the delegate and its invocation list, and only allows adding or removing targets from the invocation list.&lt;br /&gt;
&lt;br /&gt;
Three main differences: &lt;br /&gt;
events can be included in interfaces &lt;br /&gt;
events can only be invoked by the containing class &lt;br /&gt;
events&#39; signatures are constrained (depends on language and CLS compliance)&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;event:&lt;/b&gt;  &lt;br /&gt;
&lt;br /&gt;
1) It is a data member of a type(class/structure) &lt;br /&gt;
&lt;br /&gt;
2)It is declared inside a type(class/structure) &lt;br /&gt;
&lt;br /&gt;
3) It is used to generate notifications which are then passed to methods though &lt;br /&gt;
delegates. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;delegate:&lt;/b&gt;  &lt;br /&gt;
&lt;br /&gt;
1)It is a datatype(reference type) that holds references of methods with &lt;br /&gt;
some signatures.also called as function pointer. &lt;br /&gt;
&lt;br /&gt;
2)It may or may not be declared inside a class. &lt;br /&gt;
&lt;br /&gt;
3)It is used as the return type of an event and used in passing messages from event to methods. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt; event--&amp;gt;delegate--&amp;gt;method&lt;/b&gt;  &lt;br /&gt;
&lt;b&gt;example: 1&lt;/b&gt;&lt;br /&gt;
namespace dd &lt;br /&gt;
{ &lt;br /&gt;
//delegate declaration &lt;br /&gt;
delegate void first(); &lt;br /&gt;
class cc &lt;br /&gt;
{ &lt;br /&gt;
//event declaration &lt;br /&gt;
public first myevent; &lt;br /&gt;
} &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;example 2: &lt;/b&gt;&lt;br /&gt;
button1.Click+=new EventHandler(this.button1_Click); &lt;br /&gt;
&lt;br /&gt;
Click is the event that returns an instance of the EventHandler delegate. &lt;br /&gt;
EventHandler delegate has the  reference of button1_Click event and that &lt;br /&gt;
helps in the communication betwen the Click  event and button1_Click method.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/6272839457315679970/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/6272839457315679970' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/6272839457315679970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/6272839457315679970'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2012/06/difference-between-event-and-delegate.html' title='Difference between event and delegate'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-3796091738724069297</id><published>2012-06-04T12:14:00.000+05:30</published><updated>2012-06-04T12:14:17.758+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Dead letter queues in WCF"/><title type='text'>Dead letter queues in WCF</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div align=&quot;left&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: x-small;&quot;&gt;The main use of queue is  that you do not need the client and the server running at one time.  Therefore, it is possible that a message will lie in queue for long time  until the server or client picks it up. But there are scenarios where a  message is of no use after a certain time. Therefore, these kinds of  messages if not delivered within that time span it should not be sent to  the user. &lt;br /&gt;
Below is the config snippet, which defines for how much time the message should be in queue.&lt;br /&gt;
&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;pre&gt;&lt;em&gt;&lt;span style=&quot;font-family: Courier New; font-size: x-small;&quot;&gt;&amp;lt;bindings&amp;gt;
&amp;lt;netMsmqBinding&amp;gt;
&amp;lt;binding name=&quot;MyBindings&quot;
deadLetterQueue=&quot;Custom&quot;
customDeadLetterQueue=&quot;net.msmq://localhost/private/ServiceModelSamples&quot; 
timeToLive=&quot;00:00:02&quot;/&amp;gt;
&amp;lt;/netMsmqBinding&amp;gt;&lt;/span&gt;&lt;/em&gt;&lt;/pre&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/3796091738724069297/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/3796091738724069297' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/3796091738724069297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/3796091738724069297'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2012/06/dead-letter-queues-in-wcf.html' title='Dead letter queues in WCF'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-3919477709263246014</id><published>2012-06-04T12:11:00.002+05:30</published><updated>2012-06-04T12:11:43.141+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Volatile queues in WCF"/><title type='text'>Volatile queues in WCF</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: x-small;&quot;&gt;There are scenarios in the  project when you want the message to deliver in proper time. The timely  delivery of message is more important than losing message. In these  scenarios, Volatile queues are used.&lt;br /&gt;
Below is the code snippet, which  shows how to configure Volatile queues. You can see the binding  Configuration property set to Volatile Binding. This code will assure  that message will deliver on time but there is a possibility that you  can lose data. &lt;br /&gt;
&amp;nbsp;&lt;/span&gt; &lt;br /&gt;
&lt;div align=&quot;left&quot;&gt;&lt;pre&gt;&lt;em&gt;&lt;span style=&quot;font-family: Courier New; font-size: x-small;&quot;&gt;&amp;lt;appSettings&amp;gt;
&amp;lt;!-- use appSetting to configure MSMQ queue name --&amp;gt;
&amp;lt;add key=&quot;queueName&quot; value=&quot;.\private$\ServiceModelSamplesVolatile&quot; /&amp;gt;
&amp;lt;/appSettings&amp;gt;

&amp;lt;system.serviceModel&amp;gt;
&amp;lt;services&amp;gt;
&amp;lt;service name=&quot;Samples.StockTickerServ&quot;
behaviorConfiguration=&quot;CalculatorServiceBehavior&quot;&amp;gt;
...
&amp;lt;!-- Define NetMsmqEndpoint --&amp;gt;
&amp;lt;endpoint address=&quot;net.msmq://localhost/private/ServiceModelSamplesVolatile&quot;
binding=&quot;netMsmqBinding&quot;
bindingConfiguration=&quot;volatileBinding&quot; 
contract=&quot;Samples.InterfaceStockTicker&quot; /&amp;gt;
...
&amp;lt;/service&amp;gt;
&amp;lt;/services&amp;gt;

&amp;lt;bindings&amp;gt;
&amp;lt;netMsmqBinding&amp;gt;
&amp;lt;binding name=&quot;volatileBinding&quot; 
durable=&quot;false&quot;
exactlyOnce=&quot;false&quot;/&amp;gt;
&amp;lt;/netMsmqBinding&amp;gt;
&amp;lt;/bindings&amp;gt;
...
&amp;lt;/system.serviceModel&amp;gt;&lt;/span&gt;&lt;/em&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/3919477709263246014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/3919477709263246014' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/3919477709263246014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/3919477709263246014'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2012/06/volatile-queues-in-wcf.html' title='Volatile queues in WCF'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3524275722329518940.post-5573373503317023406</id><published>2012-06-01T13:22:00.000+05:30</published><updated>2012-06-01T13:22:37.766+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Type of serialization"/><title type='text'>Type of serialization</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial;&quot;&gt;.NET provides 2 ways for serializtion 1) XmlSerializer and 2) BinaryFormatter/SoapFormatter &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;XmlSerializer&lt;/b&gt; is used for Web Services. The BinaryFormatter &amp;amp;  SoapFormatter is used for Remoting. While using XmlSerializer, it is  required that the target class has parameter less constructors, has  public read-write properties and has fields that can be serialized. The  XmlSerializer has good support for XML documents. It can be used to  construct objects from existing XML documents. The XmlSerializer enables  us to serialize and deserialize objects to an XML format. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;SoapFormatter&lt;/b&gt;  enables us to serialize &amp;amp; deserialize objects to SOAP format. They  can serialize private and public fields of a class. The target class  must be marked with the Serializable attribute. On deserialization, the  constructor of the new object is not invoked. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;BinaryFormatter &lt;/b&gt;has the same features as the SoapFormatter except that  it formats data into binary format. The BinaryForamatter (and the  SoapFormatter) has two main methods. Serialize and Deserialize. To  serialize an object, we pass an instance of the stream and the object to  the Serialize method. To Deserialize an object, you pass an instance of  a stream to the Deserialize method. &lt;br /&gt;
&lt;br /&gt;
You can use the  BinaryFormatter to serialize many, but not all, classes in the .NET  Framework. For example, you can serialize ArrayLists, DataSets, and  Arrays but not other objects, such as DataReaders or TextBox controls.  To serialize a class, the class must have the Serializable attribute or  implement the ISerializable interface. &lt;br /&gt;
&lt;br /&gt;
Note that the  XmlSerializer captures only the public members of the class, whereas the  BinaryFormatter &amp;amp; the SoapFormatter captures both the public &amp;amp;  private members of the class. The output using the BinaryFormatter is  quite compact, as the information is in binary format, whereas the  XmlSerializer format is filled with XML tags.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jagdishkholiya.blogspot.com/feeds/5573373503317023406/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3524275722329518940/5573373503317023406' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/5573373503317023406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3524275722329518940/posts/default/5573373503317023406'/><link rel='alternate' type='text/html' href='http://jagdishkholiya.blogspot.com/2012/06/type-of-serialization.html' title='Type of serialization'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>