<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-297073819615100816</id><updated>2011-07-28T15:38:50.662-07:00</updated><category term='C#'/><category term='JQuery'/><category term='LINQ'/><category term='ASP.NET 2.0'/><category term='SQL Server 2008'/><category term='SQL'/><category term='WCF'/><category term='.NET Framework 4.0'/><category term='OOPS'/><category term='Inerview Questions'/><category term='Javascript'/><category term='SQL Server'/><category term='Microsoft Exams'/><category term='AJAX'/><category term='SQL Server 2005'/><category term='Raw HTML to Escaped HTML'/><category term='SQL Server Tips'/><category term='Security'/><category term='Web Service'/><category term='.NET 3.5'/><category term='ASP.NET'/><category term='Testing'/><title type='text'>.Net and SQL Server Tips &amp; Tricks</title><subtitle type='html'>Development resources, articles, tutorials, samples, codes and tools for .Net , asp.net ,c# ,LINQ and SQL Server</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default?start-index=101&amp;max-results=100'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>109</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-9163502074377383121</id><published>2010-06-15T10:54:00.000-07:00</published><updated>2010-06-15T10:55:35.274-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>How can we create Proxy for the WCF Service?</title><content type='html'>How can we create Proxy for the WCF Service?&lt;br /&gt;&lt;br /&gt;We can create proxy using the tool svcutil.exe after creating the service.&lt;br /&gt;We can use the following command at command line.&lt;br /&gt;svcutil.exe *.wsdl *.xsd /language:C# /out:SampleProxy.cs /config:app.config&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-9163502074377383121?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/9163502074377383121/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=9163502074377383121' title='23 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/9163502074377383121'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/9163502074377383121'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2010/06/how-can-we-create-proxy-for-wcf-service.html' title='How can we create Proxy for the WCF Service?'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>23</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-3545374255942647210</id><published>2010-06-12T10:40:00.000-07:00</published><updated>2010-06-25T10:44:34.315-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>What are the types of contract available in WCF?</title><content type='html'>What are the types of contract available in WCF?&lt;br /&gt;&lt;br /&gt;a)Service Contract:Describes what operations the client can perform.&lt;br /&gt;b)Operation Contract : defines the method inside Interface of Service.&lt;br /&gt;c)Data Contract:Defines what data types are passed&lt;br /&gt;&lt;br /&gt;WCF data contracts provide a mapping function between .NET CLR types that are defined in code and XML Schemas Definitions defined by the W3C organization (www.w3c.org/) that are used for communication outside&lt;br /&gt;the service.&lt;br /&gt;&lt;br /&gt;d)Message Contract:Defines wheather a service can interact directly with messages&lt;br /&gt;&lt;br /&gt;Message contracts describe the structure of SOAP messages sent to and from a service and enable you to inspect and control most of the details in the SOAP header and body. Whereas data contracts enable interoperability through the XML Schema Definition (XSD) standard, message contracts enable you to interoperate with any system that communicates through SOAP. Using message contracts gives you complete control over the SOAP message sent to and from a service by providing access to the SOAP headers and bodies directly. This allows use of simple or complex types to define the exact content of the SOAP parts.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-3545374255942647210?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/3545374255942647210/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=3545374255942647210' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3545374255942647210'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3545374255942647210'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2010/06/what-are-types-of-contract-available-in.html' title='What are the types of contract available in WCF?'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-841032901688983134</id><published>2010-06-05T23:20:00.000-07:00</published><updated>2010-06-05T23:39:40.232-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>WCF Implementation Details</title><content type='html'>&lt;p&gt;WCF Implementation Details&lt;br /&gt;--------------------------------------&lt;br /&gt;=&gt; SOA Architecture Basics&lt;br /&gt;=&gt; Web services Basics&lt;br /&gt;=&gt; WCF Basics (SOAP, WSDL, UDDI)&lt;br /&gt;=&gt; WCF Features&lt;br /&gt;=&gt; WCF Basic Terminology&lt;br /&gt;1) ABCs of WCF( address , binding , contract)&lt;br /&gt;address -&gt; HTTP,TCP,Peer network,IPC (Inter-Process Communication over named pipes),MSMQ&lt;br /&gt;binding -&gt; BasicHttpBinding,WsHttpBinding,NetTcpBinding,NetNamedPipesBinding,NetMsmqBindingcontract-&gt;Service contracts,Data contracts,Fault contracts,Message contracts, Operations&lt;br /&gt;&lt;br /&gt;hosting&lt;br /&gt;--------&lt;br /&gt;Self-hosting,IIS Server,WAS (Windows Activation Service) Server.&lt;br /&gt;2) Service Contracts and Operation Contracts&lt;br /&gt;3) Data Contracts&lt;br /&gt;4) Messag Contracts&lt;br /&gt;5) WCF Layers ( Service Model, Messaging)&lt;br /&gt;6) WCF Programming Model&lt;br /&gt;7) Endpoint&lt;br /&gt;8) WCF Architecture&lt;br /&gt;(a)Contracts- Data contract,Message Contract, Service Contract,Policy and binding&lt;br /&gt;b)Service runtime-Error behavior,metadata behavior,transaction behavior,TCP Channel&lt;br /&gt;c)Messaging- WS Security Channel,HTTP Channel,TCP Channel&lt;br /&gt;d)Activation and hosting - Windows Activation Service, .EXE,Windows service, COM+&lt;br /&gt;&lt;br /&gt;9) Host Architecture ( IIS hosting, Self-hosting, WAS hosting)&lt;br /&gt;10) Instance Management -&gt; Per call -&gt; Per session(Allowed, required, NotAllowed), -&gt; Singleton&lt;br /&gt;11) Service Throttling&lt;br /&gt;=&gt; WCF Simple Examples:&lt;br /&gt;1) New -&gt; Project -&gt; WCF Service Application&lt;br /&gt;2) New -&gt; Project -&gt; Class Library -&gt; add reference - &gt; System.ServiceModel&lt;br /&gt;3) New -&gt; Project -&gt; WCF -&gt; WCF Service Library&lt;br /&gt;4) New -&gt; Web site -&gt; WCF Service&lt;br /&gt;&lt;br /&gt;=&gt; WCF Adavanced Examples:&lt;br /&gt;1) Sessions&lt;br /&gt;2) Using Data Sets and Database Connectivity&lt;br /&gt;3) Transactions&lt;br /&gt;4) Handling Complex data types&lt;br /&gt;5) Security (Confidentiality ,Integrity,Authentication,Authorization)&lt;br /&gt;5.1) Transaport level -&gt; Using X509 Certificates&lt;br /&gt;5.2) Message Security - &gt; Using X509 Certificates&lt;br /&gt;5.3) Message Security - &gt; UserName and Password (ASP.NET Membership)&lt;br /&gt;5.4) Message Security - &gt; UserName and Password (Custom)&lt;br /&gt;X 5.5) Message Security - &gt; Issued Token&lt;br /&gt;6) Input Data Validation&lt;br /&gt;7) Ordering Input Parameters&lt;br /&gt;8) Method Overloading using "Name" attribute&lt;br /&gt;9) Interoperability (Consuming WCF Service with Java Client)&lt;br /&gt;10) Tracing &amp;amp; Logging&lt;br /&gt;=&gt; N-Tier application with WCF and DataSets in Visual Studio 2008&lt;br /&gt;=&gt; Interoperability with dotnet client on another machine with Certificate security&lt;br /&gt;=&gt; WSSF&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-841032901688983134?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/841032901688983134/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=841032901688983134' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/841032901688983134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/841032901688983134'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2010/05/wcf-implementation-details.html' title='WCF Implementation Details'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-2549250674311107301</id><published>2010-05-30T23:57:00.000-07:00</published><updated>2010-06-06T00:01:13.726-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><title type='text'>Advantage and disadvantage of LINQ?</title><content type='html'>&lt;strong&gt;Advantage and disadvantage of LINQ?&lt;br /&gt;Adv.&lt;br /&gt;&lt;/strong&gt;Allow the developers to query data without having to write data store specific code.&lt;br /&gt;It helps in Memory Collection query easily.&lt;br /&gt;&lt;strong&gt;DisAdv.:&lt;/strong&gt;&lt;br /&gt;One disadvantage I see is that it adds another layer of code, and my understanding is that it has slower performance than using stored procedures and ADO.Net. It also seems that debugging could be a challenge, especially for more complex queries, and that these might end up being moved to a stored proc anyway.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-2549250674311107301?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/2549250674311107301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=2549250674311107301' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2549250674311107301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2549250674311107301'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2010/05/advantage-and-disadvantage-of-linq.html' title='Advantage and disadvantage of LINQ?'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-4600313700657706036</id><published>2010-05-23T00:16:00.000-07:00</published><updated>2010-06-06T00:23:18.072-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>What is three major points in WCF?</title><content type='html'>What is three major points in WCF?&lt;br /&gt;We Should remember ABC.&lt;br /&gt;Address --- Specifies the location of the service which will be like http://Myserver/MyService.Clients will use this location to communicate with our service.&lt;br /&gt;&lt;br /&gt;Binding --- Specifies how the two paries will communicate in term of transport and encoding and protocols&lt;br /&gt;&lt;br /&gt;Contract --- Specifies the interface between client and the server.It's a simple interface with some attribute.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-4600313700657706036?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/4600313700657706036/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=4600313700657706036' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4600313700657706036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4600313700657706036'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2010/05/what-is-three-major-points-in-wcf.html' title='What is three major points in WCF?'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-6485348632878652706</id><published>2010-05-22T00:19:00.000-07:00</published><updated>2010-06-06T00:25:14.792-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>What are the main components of WCF?</title><content type='html'>&lt;a title="What are the main components of WCF?" href="http://www.dotnetfunda.com/interview/exam540-what-are-the-main-components-of-wcf.aspx"&gt;&lt;/a&gt;What are the main components of WCF?&lt;br /&gt;The main components of WCF are&lt;br /&gt;1. Service class&lt;br /&gt;2. Hosting environment&lt;br /&gt;3. End point&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-6485348632878652706?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/6485348632878652706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=6485348632878652706' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/6485348632878652706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/6485348632878652706'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2010/05/what-are-main-components-of-wcf.html' title='What are the main components of WCF?'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-956701959679022007</id><published>2010-05-09T00:09:00.000-07:00</published><updated>2010-06-06T00:10:23.000-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>What is the difference between WCF and ASMX Web services?</title><content type='html'>What is the difference between WCF and ASMX Web services?&lt;br /&gt;Historically, various technologies such as ASMX Web services and .NET Remoting have been available to provide communication between applications. Microsoft's WCF makes development of distributed SOA applications more intuitive and allows the developer to implement all of these technologies with a single development framework. Also, WCF makes incorporation of distributed transactions and message queues easier.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-956701959679022007?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/956701959679022007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=956701959679022007' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/956701959679022007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/956701959679022007'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2010/05/what-is-difference-between-wcf-and-asmx.html' title='What is the difference between WCF and ASMX Web services?'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-3075672773943594167</id><published>2010-04-10T00:06:00.000-07:00</published><updated>2010-06-06T00:08:45.474-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>What is SOA</title><content type='html'>What is SOA?&lt;br /&gt;Service-Oriented Architecture (SOA) describes applications as a collection of loosely coupled software services. Their interactions are based on predefined contracts listing their available functions and message structures in a way that is independent of the underlying platform and programming language.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-3075672773943594167?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/3075672773943594167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=3075672773943594167' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3075672773943594167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3075672773943594167'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2010/04/what-is-soa.html' title='What is SOA'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-8270244169202300626</id><published>2010-03-14T00:03:00.000-08:00</published><updated>2010-06-06T00:05:47.282-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>What is WCF</title><content type='html'>What is WCF?&lt;br /&gt;Windows Communication Foundation (WCF) is part of the .NET Framework 3.0 and 3.5 and is a unified network programming model that enables cross-application and cross-platform communication. With WCF, programmers can more easily and quickly build SOA applications.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-8270244169202300626?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/8270244169202300626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=8270244169202300626' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/8270244169202300626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/8270244169202300626'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2010/03/what-is-wcf.html' title='What is WCF'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-7198456017884453664</id><published>2010-02-26T22:11:00.000-08:00</published><updated>2010-02-26T23:08:33.673-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><title type='text'>.NET Framework 3.5, ASP.NET Applications certification!</title><content type='html'>&lt;p&gt;I have done the .NET Framework 3.5, ASP.NET Applications certification&lt;/p&gt;&lt;p&gt;"Congratulations on earning your Microsoft Certified Technology Specialist: .NET Framework 3.5, ASP.NET Applications certification! We hope you enjoy the benefits of your certification and of membership in the Microsoft Certified Professional community. WHAT IS NEXT? Visit the MCP member site (&lt;a href="https://mcp.microsoft.com/mcp" target="_blank"&gt;https://mcp.microsoft.com/mcp&lt;/a&gt;) to download your new logo, certificate, view and share your transcript, and access additional MCP resources. KEEP IN TOUCH! Visit the profile center and make sure you are subscribed to the MCP newsletter for updates on exams, training, and program benefits: &lt;a href="http://www.microsoft.com/learning/newsletters/default.mspx" target="_blank"&gt;http://www.microsoft.com/learning/newsletters/default.mspx&lt;/a&gt;. Connect with your peers for networking and advice in the Born to Learn blog:&lt;a href="http://blogs.technet.com/mslcommunity" target="_blank"&gt;http://blogs.technet.com/mslcommunity&lt;/a&gt; Congratulations once again,The Microsoft Certification Program Team"&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-7198456017884453664?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/7198456017884453664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=7198456017884453664' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/7198456017884453664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/7198456017884453664'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2010/02/net-framework-35-aspnet-applications.html' title='.NET Framework 3.5, ASP.NET Applications certification!'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-4398492672975175200</id><published>2010-01-11T02:22:00.000-08:00</published><updated>2010-01-11T02:25:04.937-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='JQuery'/><title type='text'>Get the url querystring value in Jquery</title><content type='html'>// Get the url querystring valuewindow.location.querystring = (function() {&lt;br /&gt;var collection = {};&lt;br /&gt;// Gets the query string, starts with '?'&lt;br /&gt;var querystring = window.location.search;&lt;br /&gt;// Empty if no query string&lt;br /&gt;if (!querystring) { return { toString: function() { return ""; } }; }&lt;br /&gt;// Decode query string and remove '?'&lt;br /&gt;querystring = decodeURI(querystring.substring(1));&lt;br /&gt;// Load the key/values of the return collection&lt;br /&gt;var pairs = querystring.split("&amp;amp;");&lt;br /&gt;for (var i = 0; i &amp;lt; pairs.length; i++) {&lt;br /&gt;// Empty pair (e.g. ?key=val&amp;amp;&amp;amp;key2=val2)&lt;br /&gt;if (!pairs[i]) { continue; }&lt;br /&gt;// Don't use split("=") in case value has "=" in it&lt;br /&gt;var seperatorPosition = pairs[i].indexOf("=");&lt;br /&gt;if (seperatorPosition == -1) { collection[pairs[i]] = ""; } else { collection[pairs[i].substring(0, seperatorPosition)] = pairs[i].substr(seperatorPosition + 1); } }&lt;br /&gt;// toString() returns the key/value pairs concatenated&lt;br /&gt;collection.toString = function() { return "?" + querystring; };&lt;br /&gt;return collection;})();&lt;br /&gt;// End Get the url querystring value&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-4398492672975175200?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/4398492672975175200/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=4398492672975175200' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4398492672975175200'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4398492672975175200'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2010/01/get-url-querystring-value-in-jquery.html' title='Get the url querystring value in Jquery'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-6424127873398269913</id><published>2009-11-17T00:57:00.000-08:00</published><updated>2009-11-17T00:58:55.478-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>How to find a text inside SQL Server procedures / triggers?</title><content type='html'>How to find a text inside SQL Server procedures / triggers?&lt;br /&gt;&lt;br /&gt;DECLARE @Search varchar(255)&lt;br /&gt;SET @Search='ItemChangesLog'&lt;br /&gt;SELECT DISTINCT&lt;br /&gt;LEFT(so.name, 100) AS Object_Name,&lt;br /&gt;"object_type"=left(&lt;br /&gt;case so.type&lt;br /&gt;when 'U' then 'Table - User'&lt;br /&gt;when 'S' then 'Table - System'&lt;br /&gt;when 'V' then 'Table - View'&lt;br /&gt;when 'TR' then 'Trigger'&lt;br /&gt;when 'P' then 'Stored Procedure'&lt;br /&gt;when 'C' then 'Constraint - Check'&lt;br /&gt;when 'D' then 'Default'&lt;br /&gt;when 'K' then 'Key - Primary'&lt;br /&gt;when 'F' then 'Key - Foreign'&lt;br /&gt;when 'L' then 'Log'&lt;br /&gt;when 'R' then 'Rule'&lt;br /&gt;when 'RF' then 'Replication Filter stp'&lt;br /&gt;else '&lt;&lt;unknown&gt;&gt;'&lt;br /&gt;end -- case so.type&lt;br /&gt;,25)&lt;br /&gt;FROM syscomments sc&lt;br /&gt;INNER JOIN sysobjects so&lt;br /&gt;ON so.id = sc.id&lt;br /&gt;WHERE&lt;br /&gt;text Like '%'+@Search+'%'&lt;br /&gt;ORDER BY&lt;br /&gt;2,1&lt;a class="question-hyperlink" href="http://stackoverflow.com/questions/674623/how-to-find-a-text-inside-sql-server-procedures-triggers"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-6424127873398269913?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/6424127873398269913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=6424127873398269913' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/6424127873398269913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/6424127873398269913'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/11/how-to-find-text-inside-sql-server.html' title='How to find a text inside SQL Server procedures / triggers?'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-4572582993985796016</id><published>2009-11-06T02:25:00.000-08:00</published><updated>2009-11-06T02:30:47.602-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>How do I find a stored procedure containing ?</title><content type='html'>How do I find a stored procedure containing &lt;text&gt;?&lt;br /&gt;SELECT     name&lt;br /&gt;FROM         sys.procedures&lt;br /&gt;WHERE     (OBJECT_DEFINITION(object_id) LIKE '%UserID%')&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-4572582993985796016?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/4572582993985796016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=4572582993985796016' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4572582993985796016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4572582993985796016'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/11/how-do-i-find-stored-procedure.html' title='How do I find a stored procedure containing &lt;text&gt;?'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-751669191720920967</id><published>2009-10-31T10:29:00.000-07:00</published><updated>2009-11-05T11:08:52.839-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Sql Server - 4th highest salary from Emp table</title><content type='html'>&lt;p&gt;The 4th highest salary from Emp table -Sql server&lt;/p&gt;&lt;p&gt;SELECT TOP 1 salary&lt;br /&gt;FROM (&lt;br /&gt;SELECT DISTINCT TOP 4 salary&lt;br /&gt;FROM emp&lt;br /&gt;ORDER BY salary DESC) a&lt;br /&gt;ORDER BY salary &lt;/p&gt;&lt;p&gt;The nth highest salary from Emp table as follows&lt;br /&gt;&lt;br /&gt;SELECT TOP 1 salary&lt;br /&gt;FROM (&lt;br /&gt;SELECT DISTINCT TOP n salary&lt;br /&gt;FROM emp&lt;br /&gt;ORDER BY salary DESC) a&lt;br /&gt;ORDER BY salary&lt;/p&gt;&lt;p&gt;Other&lt;br /&gt;=====&lt;br /&gt;SELECT MIN (SALARY )&lt;br /&gt;FROM EMP&lt;br /&gt;WHERE SALARY IN&lt;br /&gt;(SELECT DISTINCT TOP 4 SALARY&lt;br /&gt;FROM EMP&lt;br /&gt;ORDER BY SALARY DESC)&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-751669191720920967?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/751669191720920967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=751669191720920967' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/751669191720920967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/751669191720920967'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/10/sql-server-4th-highest-salary-from-emp.html' title='Sql Server - 4th highest salary from Emp table'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-8434468135627060359</id><published>2009-08-02T11:25:00.000-07:00</published><updated>2009-08-02T12:10:09.546-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='JQuery'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET 2.0'/><title type='text'>Problem lose the drag and drop capability from update panel then call jQuery code from ASP.NET Server-Side</title><content type='html'>I am using the jQuery for the drag and drop functionality. When refresh the contents of the update panel and hence the HTML controls lose the drag and drop capability.&lt;br /&gt;&lt;br /&gt;I'm using the .net &lt;strong&gt;ScriptManager.RegisterClientScriptBlock&lt;/strong&gt; method to register my script , so that all items from the HTML control can be "Draggables".&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ScriptManager.RegisterClientScriptBlock(this,this.GetType(),"script", "DragAndDrop();", true);&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The catch is that using ClientScript.RegisterClientScriptBlock simply won’t render your scripts when the request is coming from an AsyncPostbackTrigger of an UpdatePanel. In this case you’ll need to call&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ScriptManager.RegisterClientScriptBlock.&lt;br /&gt;&lt;br /&gt;Registers a client script block with the ScriptManager control for use with a control that is inside an &lt;em&gt;&lt;strong&gt;UpdatePanel&lt;/strong&gt;&lt;/em&gt; control, and then adds the script block to the page.&lt;br /&gt;&lt;br /&gt;RegisterClientScriptBlock(Control, Type, String, String, Boolean)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-8434468135627060359?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/8434468135627060359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=8434468135627060359' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/8434468135627060359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/8434468135627060359'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/08/problem-lose-drag-and-drop-capability.html' title='Problem lose the drag and drop capability from update panel then call jQuery code from ASP.NET Server-Side'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-3246003504219356708</id><published>2009-07-18T13:33:00.000-07:00</published><updated>2009-07-23T13:36:17.945-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>.NET Collections</title><content type='html'>System.Collections.IEnumerable&lt;br /&gt;&lt;br /&gt;Exposes the enumerator, which supports a simple iteration over a non-generic collection.&lt;br /&gt;Assembly: mscorlib, Version=3.5.0.0&lt;br /&gt;Inherits nothing, this is the base interface.&lt;br /&gt;Methods &lt;br /&gt;Function GetEnumerator() As IEnumerator &lt;br /&gt;Returns an enumerator that iterates through a collection.&lt;br /&gt;System.Collections.ICollection&lt;br /&gt;&lt;br /&gt;Defines size, enumerators, and synchronization methods for all non-generic collections.&lt;br /&gt;Assembly: mscorlib, Version=3.5.0.0&lt;br /&gt;Inherits IEnumerable&lt;br /&gt;Methods&lt;br /&gt;Sub CopyTo(ByVal array As Array, ByVal index As Integer) &lt;br /&gt;Copies the elements of the ICollection to an Array.&lt;br /&gt;IDictionary and IList are more specialized interfaces that extend ICollection.&lt;br /&gt;If neither the IDictionary interface nor the IList interface meet the requirements of the required collection, derive the new collection class from the ICollection interface instead for more flexibility.&lt;br /&gt;System.Collections.IDictionary&lt;br /&gt;&lt;br /&gt;Represents a non-generic collection of key/value pairs.&lt;br /&gt;Assembly: mscorlib, Version=3.5.0.0&lt;br /&gt;Inherits ICollection, IEnumerable&lt;br /&gt;Methods &lt;br /&gt;Sub Add(ByVal key As Object, ByVal value As Object) &lt;br /&gt;Sub Clear()&lt;br /&gt;Function Contains(ByVal key As Object) As Boolean &lt;br /&gt;Function GetEnumerator() As IDictionaryEnumerator &lt;br /&gt;Sub Remove(ByVal key As Object)&lt;br /&gt;System.Collections.IList&lt;br /&gt;&lt;br /&gt;Represents a non-generic collection of objects that can be individually accessed by index.&lt;br /&gt;Assembly: mscorlib, Version=3.5.0.0&lt;br /&gt;Inherits ICollection, IEnumerable&lt;br /&gt;Methods &lt;br /&gt;Function Add(ByVal value As Object) As Integer &lt;br /&gt;Sub Clear() &lt;br /&gt;Function Contains(ByVal value As Object) As Boolean &lt;br /&gt;Function IndexOf(ByVal value As Object) As Integer &lt;br /&gt;Sub Insert(ByVal index As Integer, ByVal value As Object) &lt;br /&gt;Sub Remove(ByVal value As Object) &lt;br /&gt;Sub RemoveAt(ByVal index As Integer)&lt;br /&gt;System.Collections.Hashtable&lt;br /&gt;&lt;br /&gt;Represents a collection of key/value pairs that are organized based on the hash code of the key.&lt;br /&gt;Assembly: mscorlib, Version=3.5.0.0&lt;br /&gt;Implements IDictionary, ICollection, IEnumerable, ISerializable, IDeserializationCallback, ICloneable&lt;br /&gt;Hashtable is thread safe for use by multiple reader threads and a single writing thread. &lt;br /&gt;System.Collections.ArrayList&lt;br /&gt;&lt;br /&gt;Implements the IList interface using an array whose size is dynamically increased as required.&lt;br /&gt;Assembly: mscorlib, Version=3.5.0.0&lt;br /&gt;Implements IList, ICollection, IEnumerable, ICloneable&lt;br /&gt;Public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.&lt;br /&gt;System.Collections.CollectionBase&lt;br /&gt;&lt;br /&gt;Provides the abstract base class for a strongly typed collection.&lt;br /&gt;Assembly: mscorlib, Version=3.5.0.0&lt;br /&gt;Implements IList, ICollection, IEnumerable&lt;br /&gt;Public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.&lt;br /&gt;System.Collections.Specialized.StringDictionary&lt;br /&gt;&lt;br /&gt;Implements a hash table with the key and the value strongly typed to be strings rather than objects.&lt;br /&gt;Assembly: System, Version=3.5.0.0&lt;br /&gt;Implements IEnumerable&lt;br /&gt;Methods &lt;br /&gt;Public Sub New()&lt;br /&gt;Public Overridable Sub Add(ByVal key As String, ByVal value As String) &lt;br /&gt;Public Overridable Sub Clear() &lt;br /&gt;Public Overridable Function ContainsKey(ByVal key As String) As Boolean &lt;br /&gt;Public Overridable Function ContainsValue(ByVal value As String) As Boolean&lt;br /&gt;Public Overridable Sub CopyTo(ByVal array As Array, ByVal index As Integer) &lt;br /&gt;Public Overridable Function GetEnumerator() As IEnumerator &lt;br /&gt;Public Overridable Sub Remove(ByVal key As String)&lt;br /&gt;Instead of this class, you should use Dictionary&lt;TKey, TValue&gt; instead&lt;br /&gt;Public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.&lt;br /&gt;Thread Safety&lt;br /&gt;&lt;br /&gt;Enumerating through a collection is intrinsically not a thread-safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads. &lt;br /&gt;Reference:&lt;br /&gt;&lt;br /&gt;System.Collections Namespace&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-3246003504219356708?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/3246003504219356708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=3246003504219356708' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3246003504219356708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3246003504219356708'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/07/net-collections.html' title='.NET Collections'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-4565920313624593664</id><published>2009-07-05T11:26:00.000-07:00</published><updated>2009-07-08T11:35:13.639-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><title type='text'>101 LINQ samples for C#</title><content type='html'>a wonderful learning LINQ resource.&lt;br /&gt;&lt;br /&gt;http://msdn.microsoft.com/en-us/vcsharp/aa336746.aspx&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-4565920313624593664?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/4565920313624593664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=4565920313624593664' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4565920313624593664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4565920313624593664'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/07/101-linq-samples-for-c.html' title='101 LINQ samples for C#'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-2509586876239729677</id><published>2009-06-22T11:23:00.000-07:00</published><updated>2009-06-22T11:25:33.663-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='OOPS'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>OOPs FAQs : Object Oriented Interview Questions</title><content type='html'>OOPs FAQs : Object Oriented Interview Questions&lt;br /&gt;&lt;br /&gt;Class&lt;br /&gt;&lt;br /&gt;A user-defined data structure that groups properties and methods. Class doesn’t occupies memory.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Object&lt;br /&gt;Instance of Class is called object. An object is created in memory using keyword “new”.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Difference between Struct and Class&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Struct are Value type and are stored on stack, while Class are Reference type and are stored on heap.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Struct “do not support” inheritance, while class supports inheritance. However struct can implements interface.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Struct should be used when you want to use a small data structure, while Class is better choice for complex data structure.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What is the difference between instantiating structures with and without using the new keyword?&lt;br /&gt;When a structure is instantiated using the new keyword, a constructor (no-argument or custom, if provided) is called which initializes the fields in the structure. When a structure is instantiated without using the new keyword, no constructor is called. Hence, one has to explicitly initialize all the fields of the structure before using it when instantiated without the new keyword.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Encapsulation&lt;br /&gt;Wrapping up of data and function into a single unit is known as Encapsulation.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Properties&lt;br /&gt;Attribute of object is called properties. Eg1:- A car has color as property.&lt;br /&gt;&lt;br /&gt;Eg2:&lt;br /&gt;&lt;br /&gt;private string m_Color;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public string Color&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;get&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;return m_Color;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;set&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;m_Color = value;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Car Maruti = new Car();&lt;br /&gt;&lt;br /&gt;Maruti.Color= “White”;&lt;br /&gt;&lt;br /&gt;Console.Write(Maruti.Color);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Isn't it better to make a field public than providing its property with both set { } and get { } block? After all the property will allow the user to both read and modify the field so why not use public field instead? Motivate your answerNot always! Properties are not just to provide access to the fields; rather, they are supposed to provide controlled access to the fields of our class. As the state of the class depends upon the values of its fields, using properties we can assure that no invalid (or unacceptable) value is assigned to the fields.Eg:private int age;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public int Age&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;get&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;return age;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;set&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if(value &lt;&gt; 100)&lt;br /&gt;&lt;br /&gt;//throw exception&lt;br /&gt;&lt;br /&gt;else&lt;br /&gt;&lt;br /&gt;age = value;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;this Keyword&lt;br /&gt;&lt;br /&gt;Each object has a reference “this” which points to itself.&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt;Two uses of this keyword.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt;o Can be used to refer to the current object.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt;o It can also be used by one constructor to explicitly invoke another constructor of the same class.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;Eg1:&lt;br /&gt;&lt;br /&gt;class Student&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;private string name;&lt;br /&gt;&lt;br /&gt;private int age;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Student(string name, int age)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;this.name = name;&lt;br /&gt;&lt;br /&gt;this.age = age;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Eg2:&lt;br /&gt;&lt;br /&gt;class Circle&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;double x,y,radius;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Circle(double x){&lt;br /&gt;&lt;br /&gt;this(x,0,1);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Circle(double x, double y){&lt;br /&gt;&lt;br /&gt;this(x,y,1);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Circle(double x, double y, double radius){&lt;br /&gt;&lt;br /&gt;this.x = x;&lt;br /&gt;&lt;br /&gt;this.y = y;&lt;br /&gt;&lt;br /&gt;this.radius = radius;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Constructor&lt;br /&gt;&lt;!--[if !supportLists]--&gt; A constructor is a special method whose task is to initialize the object of its class.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; It is special because its name is the same as the class name.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; They do not have return types, not even void and therefore they cannot return values.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; They cannot be inherited, though a derived class can call the base class constructor.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Constructor is invoked whenever an object of its associated class is created.&lt;!--[endif]--&gt;&lt;br /&gt;Note: There is always atleast one constructor in every class. If you do not write a constructor, C# automatically provides one for you, this is called default constructor. Eg: class A, default constructor is A().&lt;br /&gt;&lt;!--[if !supportLists]--&gt;&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Static Members of the class&lt;br /&gt;Static members belong to the whole class rather than to individual object&lt;br /&gt;Static members are accessed with the name of class rather than reference to objects.&lt;br /&gt;&lt;br /&gt;Eg:&lt;br /&gt;&lt;br /&gt;class Test&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;public int rollNo;&lt;br /&gt;&lt;br /&gt;public int mathsMarks;&lt;br /&gt;&lt;br /&gt;public static int totalMathMarks;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;class TestDemo&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;public static void main()&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;Test stud1 = new Test();&lt;br /&gt;&lt;br /&gt;stud1.rollNo = 1;&lt;br /&gt;&lt;br /&gt;stud1.mathsMarks = 40;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;stud2.rollNo = 2;&lt;br /&gt;&lt;br /&gt;stud2.mathsMarks = 43;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Test.totalMathsMarks = stud1.mathsMarks + stud2.mathsMarks;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Static Method of the class&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Methods that you can call directly without first creating an instance of a class. Eg: Main() Method, Console.WriteLine()&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; You can use static fields, methods, properties and even constructors which will be called before any instance of the class is created. &lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; As static methods may be called without any reference to object, you can not use instance members inside static methods or properties, while you may call a static member from a non-static context. The reason for being able to call static members from non-static context is that static members belong to the class and are present irrespective of the existence of even a single object.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Static Constructor&lt;br /&gt;In C# it is possible to write a static no-parameter constructor for a class. Such a class is executed once, when first object of class is created.&lt;br /&gt;&lt;br /&gt;One reason for writing a static constructor would be if your class has some static fields or properties that need to be initialized from an external source before the class is first used.&lt;br /&gt;&lt;br /&gt;Eg:&lt;br /&gt;&lt;br /&gt;Class MyClass&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;static MyClass()&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;//Initialization Code for static fields and properties.&lt;br /&gt;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Finalize() Method of Object class&lt;br /&gt;Each class in C# is automatically (implicitly) inherited from the Object class which contains a method Finalize(). This method is guaranteed to be called when your object is garbage collected (removed from memory). You can override this method and put here code for freeing resources that you reserved when using the object. &lt;br /&gt;&lt;br /&gt;For example&lt;br /&gt;&lt;br /&gt;Protected override void Finalize()&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;try&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;Console.WriteLine(“Destructing Object….”);&lt;br /&gt;&lt;br /&gt;//put some code here.&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;finally&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;base.Finalize();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Destructor&lt;br /&gt;&lt;!--[if !supportLists]--&gt; A destructor is just opposite to constructor.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; It has same as the class name, but with prefix ~ (tilde).&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; They do not have return types, not even void and therefore they cannot return values.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; destructor is invoked whenever an object is about to be garbage collected&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;Eg:&lt;br /&gt;&lt;br /&gt;class person&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;//constructor&lt;br /&gt;&lt;br /&gt;person()&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//destructor&lt;br /&gt;&lt;br /&gt;~person()&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;//put resource freeing code here.&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What is the difference between the destructor and the Finalize() method? When does the Finalize() method get called?&lt;br /&gt;Finalize() corresponds to the .Net Framework and is part of the System.Object class. Destructors are C#'s implementation of the Finalize() method. The functionality of both Finalize() and the destructor is the same, i.e., they contain code for freeing the resources when the object is about to be garbage collected. In C#, destructors are converted to the Finalize() method when the program is compiled. The Finalize() method is called by the .Net Runtime and we can not predict when it will be called. It is guaranteed to be called when there is no reference pointing to the object and the object is about to be garbage collected.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Garbage Collection&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Garbage collection is the mechanism that reclaims the memory resources of an object when it is no longer referenced by a variable.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; .Net Runtime performs automatically performs garbage collection, however you can force the garbage collection to run at a certain point in your code by calling System.GC.Collect().&lt;!--[endif]--&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Advantage of Garbage collection : It prevents programming error that could otherwise occur by incorrectly deleting or failing to delete objects.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Enumeration&lt;br /&gt;Enumeration improves code readability. It also helps in avoiding typing mistake.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Concept of Heap and Stack&lt;br /&gt;&lt;br /&gt;Local Variables&lt;br /&gt; Stack &lt;br /&gt;Free Memory &lt;br /&gt;&lt;br /&gt;(Larger Memory Area than Stack).&lt;br /&gt; Heap&lt;br /&gt; &lt;br /&gt;Global Variables&lt;br /&gt; Permanent Storage area&lt;br /&gt; &lt;br /&gt;Program Instruction&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The Program Instruction and Global and Static variables are stored in a region known as permanent storage area and the local variables are stored in another area called stack. The memory space located between these two regions is available for dynamic memory allocation during execution of program. This free memory region is called heap. The size of heap keeps on changing when program is executed due to creation and death of variables that are local to functions and blocks. Therefore, it is possible to encounter memory “overflow” during dynamic allocation process.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLineBreakNewLine]--&gt; &lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;Value Type and Reference Type&lt;br /&gt;&lt;br /&gt;A variable is value type or reference type is solely determined by its data type.&lt;br /&gt;&lt;br /&gt;Eg: int, float, char, decimal, bool, decimal, struct, etc are value types, while object type such as class, String, Array, etc are reference type.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Value Type&lt;br /&gt;&lt;!--[if !supportLists]--&gt; As name suggest Value Type stores “value” directly.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; For eg: &lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; //I and J are both of type int&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; I = 20;&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; J = I;&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; int is a value type, which means that the above statements will results in two locations in memory.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; For each instance of value type separate memory is allocated.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Stored in a Stack.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; It Provides Quick Access, because of value located on stack.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Reference Type&lt;br /&gt;&lt;!--[if !supportLists]--&gt; As name suggest Reference Type stores “reference” to the value.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; For eg: &lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Vector X, Y; //Object is defined. (No memory is allocated.)&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; X = new Vector(); //Memory is allocated to Object. //(new is responsible for allocating memory.)&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; X.value = 30; //Initialising value field in a vector class.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Y = X; //Both X and Y points to same memory location. //No memory is created for Y.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Console.writeline(Y.value); //displays 30, as both points to same memory&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Y.value = 50;&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Console.writeline(X.value); //displays 50.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Note: If a variable is reference it is possible to indicate that it does not refer to any object by setting its value to null;&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Reference type are stored on Heap.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; It provides comparatively slower access, as value located on heap.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ref keyword &lt;br /&gt;&lt;br /&gt;Passing variables by value is the default. However, we can force the value parameter to be passed by reference. Note: variable “must” be initialized before it is passed into a method.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;out keyword&lt;br /&gt;&lt;br /&gt;out keyword is used for passing a variable for output purpose. It has same concept as ref keyword, but passing a ref parameter needs variable to be initialized while out parameter is passed without initialized. &lt;br /&gt;&lt;br /&gt;It is useful when we want to return more than one value from the method.&lt;br /&gt;&lt;br /&gt;Note: You must assigned value to out parameter in method body, otherwise the method won’t compiled.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Boxing and Un-Boxing&lt;br /&gt;Boxing: means converting value-type to reference-type.&lt;br /&gt;&lt;br /&gt;Eg:&lt;br /&gt;&lt;br /&gt;int I = 20;&lt;br /&gt;&lt;br /&gt;string s = I.ToSting();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;UnBoxing: means converting reference-type to value-type.&lt;br /&gt;&lt;br /&gt;Eg:&lt;br /&gt;&lt;br /&gt;int I = 20;&lt;br /&gt;&lt;br /&gt;string s = I.ToString(); //Box the int&lt;br /&gt;&lt;br /&gt;int J = Convert.ToInt32(s); //UnBox it back to an int.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note: Performance Overheads due to boxing and unboxing as the boxing makes a copy of value type from stack and place it inside an object of type System.Object in the heap.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Inheritance&lt;br /&gt;The process of sub-classing a class to extend its functionality is called Inheritance.&lt;br /&gt;&lt;br /&gt;It provides idea of reusability.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Order of Constructor execution in Inheritance&lt;br /&gt;constructors are called in the order from the top to the bottom (parent to child class) in inheritance hierarchy. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Order of Destructor execution in Inheritance&lt;br /&gt;The destructors are called in the reverse order, i.e., from the bottom to the top (child to parent class) in the inheritance hierarchy.&lt;br /&gt;&lt;br /&gt;What are Sealed Classes in C#?&lt;br /&gt;The sealed modifier is used to prevent derivation from a class. A compile-time error occurs if a sealed class is specified as the base class of another class. (A sealed class cannot also be an abstract class) &lt;br /&gt;&lt;br /&gt;Can you prevent your class from being inherited by another class?&lt;br /&gt;Yes. The keyword “sealed” will prevent the class from being inherited.&lt;br /&gt;&lt;br /&gt;Can you allow a class to be inherited, but prevent the method from being over-ridden?&lt;br /&gt;Yes. Just leave the class public and make the method sealed. &lt;br /&gt;&lt;br /&gt;Fast Facts of Inheritance&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Multiple inheritance of classes is not allowed in C#.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; In C# you can implements more than one interface, thus multiple inheritance is achieved through interface.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; The Object class defined in the System namespace is implicitly the ultimate base class of all the classes in C# (and the .NET framework) &lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Structures (struct) in C# does not support inheritance, it can only implements interfaces.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Polymorphism&lt;br /&gt;Polymorphism means same operation may behave differently on different classes.&lt;br /&gt;&lt;br /&gt;Eg:&lt;br /&gt;&lt;br /&gt;Method Overloading is an example of Compile Time Polymorphism.&lt;br /&gt;&lt;br /&gt;Method Overriding is an example of Run Time Polymorphism&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Does C#.net supports multiple inheritance?&lt;br /&gt;&lt;br /&gt;No. A class can inherit from only one base class, however a class can implements many interface, which servers some of the same purpose without increasing complexity.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How many types of Access Modifiers.&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt;1) Public – Allows the members to be globally accessible.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt;2) Private – Limits the member’s access to only the containing type.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt;3) Protected – Limits the member’s access to the containing type and all classes derived from the containing type.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt;4) Internal – Limits the member’s access to within the current project.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Method Overloading&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Method with same name but with different arguments is called method overloading.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Method Overloading forms compile-time polymorphism.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Eg:&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;class A1&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;void hello()&lt;br /&gt;&lt;br /&gt;{ Console.WriteLine(“Hello”); }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void hello(string s)&lt;br /&gt;&lt;br /&gt;{ Console.WriteLine(“Hello {0}”,s); }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Method Overriding&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Method overriding occurs when child class declares a method that has the same type arguments as a method declared by one of its superclass.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Method overriding forms Run-time polymorphism.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Note: By default functions are not virtual in C# and so you need to write “virtual” explicitly. While by default in Java each function are virtual.&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--[if !supportLists]--&gt; Eg1:&lt;!--[endif]--&gt;&lt;br /&gt;&lt;br /&gt;Class parent&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;virtual void hello()&lt;br /&gt;&lt;br /&gt;{ Console.WriteLine(“Hello from Parent”); }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Class child : parent&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;override void hello()&lt;br /&gt;&lt;br /&gt;{ Console.WriteLine(“Hello from Child”); }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;static void main()&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;parent objParent = new child();&lt;br /&gt;&lt;br /&gt;objParent.hello();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//Output&lt;br /&gt;&lt;br /&gt;Hello from Child.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Virtual Method&lt;br /&gt;By declaring base class function as virtual, we allow the function to be overridden in any of derived class.&lt;br /&gt;&lt;br /&gt;Eg:&lt;br /&gt;&lt;br /&gt;Class parent&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;virtual void hello()&lt;br /&gt;&lt;br /&gt;{ Console.WriteLine(“Hello from Parent”); }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Class child : parent&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;override void hello()&lt;br /&gt;&lt;br /&gt;{ Console.WriteLine(“Hello from Child”); }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;static void main()&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;parent objParent = new child();&lt;br /&gt;&lt;br /&gt;objParent.hello();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//Output&lt;br /&gt;&lt;br /&gt;Hello from Child.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-2509586876239729677?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/2509586876239729677/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=2509586876239729677' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2509586876239729677'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2509586876239729677'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/06/oops-faqs-object-oriented-interview.html' title='OOPs FAQs : Object Oriented Interview Questions'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-329331384072389144</id><published>2009-06-22T11:12:00.000-07:00</published><updated>2009-06-22T11:23:05.257-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='OOPS'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Concept of Interface / What is Interface</title><content type='html'>· An Interface is a group of constants and method declaration. &lt;br /&gt;· .Net supports multiple inheritance through Interface. &lt;br /&gt;· Interface states “what” to do, rather than “how” to do. &lt;br /&gt;· An interface defines only the members that will be made available by an implementing object. The definition of the interface states nothing about the implementation of the members, only the parameters they take and the types of values they will return. Implementation of an interface is left entirely to the implementing class. It is possible, therefore, for different objects to provide dramatically different implementations of the same members. &lt;br /&gt;· Example1, the Car object might implement the IDrivable interface (by convention, interfaces usually begin with I), which specifies the GoForward, GoBackward, and Halt methods. Other classes, such as Truck, Aircraft, Train or Boat might implement this interface and thus are able to interact with the Driver object. The Driver object is unaware of which interface implementation it is interacting with; it is only aware of the interface itself. &lt;br /&gt;· Example2, an interface named IShape, which defines a single method CalculateArea. A Circle class implementing this interface will calculate its area differently than a Square class implementing the same interface. However, an object that needs to interact with an IShape can call the CalculateArea method in either a Circle or a Square and obtain a valid result. &lt;br /&gt;· Practical Example&lt;br /&gt;public interface IDrivable&lt;br /&gt;{&lt;br /&gt;void GoForward(int Speed);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class Truck : IDrivable&lt;br /&gt;{&lt;br /&gt;public void GoForward(int Speed)&lt;br /&gt;{&lt;br /&gt;// Implementation omitted&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class Aircraft : IDrivable&lt;br /&gt;{&lt;br /&gt;public void GoForward(int Speed)&lt;br /&gt;{&lt;br /&gt;// Implementation omitted&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class Train : IDrivable&lt;br /&gt;{&lt;br /&gt;public void GoForward(int Speed)&lt;br /&gt;{&lt;br /&gt;// Implementation omitted&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;· Each variable declared in interface must be assigned a constant value. &lt;br /&gt;· Every interface variable is implicitly public, static and final. &lt;br /&gt;· Every interface method is implicitly public and abstract. &lt;br /&gt;· Interfaces are allowed to extends other interfaces, but sub interface cannot define the methods declared in the super interface, as sub interface is still interface and not class. &lt;br /&gt;· If a class that implements an interface does not implements all the methods of the interface, then the class becomes an abstract class and cannot be instantiated. &lt;br /&gt;· Both classes and structures can implement interfaces, including multiple interfaces.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-329331384072389144?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/329331384072389144/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=329331384072389144' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/329331384072389144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/329331384072389144'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/06/concept-of-interface-what-is-interface.html' title='Concept of Interface / What is Interface'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-5448322426146569712</id><published>2009-06-22T11:10:00.000-07:00</published><updated>2009-06-22T11:12:03.867-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='OOPS'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Making choice between Interface and Abstract Class</title><content type='html'>In which Scenario you will go for Interface or Abstract Class?&lt;br /&gt;&lt;br /&gt;Interfaces, like classes, define a set of properties, methods, and events. But unlike classes, interfacesdo not provide implementation. They are implemented by classes, and defined as separate entities fromclasses. Even though class inheritance allows your classes to inherit implementation from a base class, italso forces you to make most of your design decisions when the class is first published.&lt;br /&gt;&lt;br /&gt;Abstract classes are useful when creating components because they allow you specify an invariant levelof functionality in some methods, but leave the implementation of other methods until a specificimplementation of that class is needed. They also version well, because if additional functionality isneeded in derived classes, it can be added to the base class without breaking code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-5448322426146569712?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/5448322426146569712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=5448322426146569712' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/5448322426146569712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/5448322426146569712'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/06/making-choice-between-interface-and.html' title='Making choice between Interface and Abstract Class'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-4401033797259848574</id><published>2009-06-22T10:57:00.000-07:00</published><updated>2009-06-22T11:05:03.879-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><title type='text'>.NET Framework 3.5 New Features</title><content type='html'>.NET Framework 3.5 New Features&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Faster .NET Framework execution&lt;br /&gt;&lt;br /&gt;1. Faster garbage collection&lt;br /&gt;&lt;br /&gt;2. Smarter, faster NGen requiring smaller working set RAM&lt;br /&gt;&lt;br /&gt;3. 64 bit client improvements&lt;br /&gt;&lt;br /&gt;4. ThreadPool performance improvements&lt;br /&gt;&lt;br /&gt;5. Security check caching during NGen &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Base Class Library – New Class Additions&lt;br /&gt;&lt;br /&gt;6. BigInteger, HashSet and DateTime2 types&lt;br /&gt;&lt;br /&gt;7. NSA Suite ”B” and FIPs compliant cryptography&lt;br /&gt;&lt;br /&gt;8. Lightweight Reader/Writer Lock Classes&lt;br /&gt;&lt;br /&gt;9. Anonymous and Named Pipes IO Classes&lt;br /&gt;&lt;br /&gt;10. Integration with Event Tracing for Windows&lt;br /&gt;&lt;br /&gt;11. New Addin hosting model for extensibility &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Language Integrated Query (LINQ)&lt;br /&gt;&lt;br /&gt;Deep integration of LINQ data-awareness into the programming languages and framework.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Workflow Enabled Services – Process and Messaging together&lt;br /&gt;&lt;br /&gt;Using workflow to provide for durable and long-running services. New Tools, WF activities and new programming model classes have been added to simplify building workflow-enabled services using WF and WCF. This allows a .NET Framework developer to build business logic for a service using WF and expose messaging from that service using WCF. These improvements not only provide tools for this scenario but they reduce the amount of glue code that was previously required.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Web 2.0 Friendly and AJAX Enabled WCF Services&lt;br /&gt;&lt;br /&gt;Ajax is a web development technique for making asynchronous exchanges of small amounts of data between browser and web service calls from the browser client script to the web server. A programming model is provided for building Ajax style web applications using WCF services. An HTTP programming model is also provided allowing for REST style web services.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Visual Studio Developer Tools for WF, WCF and in Visual Studio “Orcas”&lt;br /&gt;&lt;br /&gt;Visual Studio”Orcas” has built in tools for web service authoring with WCF and for building workflow enabled software with WF. There are new project templates for WCF services, WF business logic, workflow enabled services, and AJAX services. The templates are conveniently set up to compile and run even before any custom code is added enabling .NET developers to get going quickly. There are also numerous other tools for developing with WF, WCF and WPF. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;More WS-* Standards Support&lt;br /&gt;&lt;br /&gt;Implementation in WCF of the latest OASIS specifications Web Services Atomic Transaction (WS-AtomicTransaction) 1.1, WS-ReliableMessaging 1.1, WS-SecureCOnversation and Web Services Coordination (WS-Coordination) 1.1. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;RSS and ATOM Syndication API&lt;br /&gt;&lt;br /&gt;Applications built using WCF will be able to easily expose syndicated data which can be consumed by an RSS or ATOM reader. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Partial Trust Support for WCF Hosting&lt;br /&gt;&lt;br /&gt;Partial trust on the vlient is provided for ASMX parity focussing mainly on partially trusted WCF applications deployed through click-once. Support is provided for basic HTTP binding provided that the application runs in the Internet zone permissions and have granted the apropriate WebPermission. Secure communication is possible through transport security only. All other features are not available to partially trusted applications including hosting services, duplex communications, non-HTTP transports, WS-* protocols and any WF use. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Rules Data Improvements&lt;br /&gt;&lt;br /&gt;The rules engine in WF is improved to add support for C# 3.0 extension metods, and for operator overloading . Also the ”new” operator is added to compete the base set of expression types. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Built-in WPF tools for Visual Studio “Orcas”&lt;br /&gt;&lt;br /&gt;The Visual Studio designer for WPF was previously released as a CTP. It is not integrated into the development environment and is significantly improved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Additional WPF Features and Improved Performance&lt;br /&gt;&lt;br /&gt;WPF has smoother animations, faster startup and better overall performance. There are also new data types available for data binding with LINQ. Better integration support is now provided for with codename “WPF/E”.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-4401033797259848574?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/4401033797259848574/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=4401033797259848574' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4401033797259848574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4401033797259848574'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/06/net-framework-35-new-features.html' title='.NET Framework 3.5 New Features'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-2770626640688167216</id><published>2009-06-22T10:54:00.000-07:00</published><updated>2009-06-22T10:57:15.867-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><title type='text'>What Tool you have used for checking Query Optimization? What is</title><content type='html'>What Tool you have used for checking Query Optimization? What is&lt;br /&gt;&lt;br /&gt;the use of profiler in sql server? What is the first thing u look at&lt;br /&gt;in a SQL Profiler?&lt;br /&gt;&lt;br /&gt;SQL Profiler is a graphical tool that allows system administrators to&lt;br /&gt;monitor events in an instance of Microsoft® SQL Server™. You can&lt;br /&gt;capture and save data about each event to a file or SQL Server table&lt;br /&gt;to analyze later. For example, you can monitor a production&lt;br /&gt;environment to see which stored procedures is hampering performance by&lt;br /&gt;executing too slowly.&lt;br /&gt;Use SQL Profiler to:&lt;br /&gt;• Monitor the performance of an instance of SQL Server.&lt;br /&gt;• Debug Transact-SQL statements and stored procedures.&lt;br /&gt;• Identify slow-executing queries.&lt;br /&gt;• Test SQL statements and stored procedures in the development phase&lt;br /&gt;of a project by single-stepping through statements to confirm that the&lt;br /&gt;code works as expected.&lt;br /&gt;• Troubleshoot problems in SQL Server by capturing events on a&lt;br /&gt;production system and replaying them on a test system. This is useful&lt;br /&gt;for testing or debugging purposes and allows users to continue using&lt;br /&gt;the production system without interference.&lt;br /&gt;Audit and review activity that occurred on an instance of SQL Server.&lt;br /&gt;This allows a security administrator to review any of the auditing&lt;br /&gt;events, including the success and failure of a login attempt and the&lt;br /&gt;success and failure of permissions in accessing statements and objects&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-2770626640688167216?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/2770626640688167216/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=2770626640688167216' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2770626640688167216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2770626640688167216'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/06/what-tool-you-have-used-for-checking.html' title='What Tool you have used for checking Query Optimization? What is'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-1739529744947614437</id><published>2009-06-22T10:53:00.000-07:00</published><updated>2009-06-22T10:54:11.758-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><title type='text'>SQL Optimization</title><content type='html'>SQL Optimization Tips &lt;br /&gt;&lt;br /&gt;• Use views and stored procedures instead of heavy-duty queries.&lt;br /&gt;This can reduce network traffic, because your client will send to&lt;br /&gt;server only stored procedure or view name (perhaps with some&lt;br /&gt;parameters) instead of large heavy-duty queries text. This can be used&lt;br /&gt;to facilitate permission management also, because you can restrict&lt;br /&gt;user access to table columns they should not see.&lt;br /&gt;&lt;br /&gt;• Try to use constraints instead of triggers, whenever possible.&lt;br /&gt;Constraints are much more efficient than triggers and can boost&lt;br /&gt;performance. So, you should use constraints instead of triggers,&lt;br /&gt;whenever possible.&lt;br /&gt;&lt;br /&gt;• Use table variables instead of temporary tables.&lt;br /&gt;Table variables require less locking and logging resources than&lt;br /&gt;temporary tables, so table variables should be used whenever possible.&lt;br /&gt;The table variables are available in SQL Server 2000 only.&lt;br /&gt;&lt;br /&gt;• Try to use UNION ALL statement instead of UNION, whenever possible.&lt;br /&gt;The UNION ALL statement is much faster than UNION, because UNION ALL&lt;br /&gt;statement does not look for duplicate rows, and UNION statement does&lt;br /&gt;look for duplicate rows, whether or not they exist.&lt;br /&gt;&lt;br /&gt;• Try to avoid using the DISTINCT clause, whenever possible.&lt;br /&gt;Because using the DISTINCT clause will result in some performance&lt;br /&gt;degradation, you should use this clause only when it is necessary.&lt;br /&gt;&lt;br /&gt;• Try to avoid using SQL Server cursors, whenever possible.&lt;br /&gt;SQL Server cursors can result in some performance degradation in&lt;br /&gt;comparison with select statements. Try to use correlated sub-query or&lt;br /&gt;derived tables, if you need to perform row-by-row operations.&lt;br /&gt;&lt;br /&gt;• Try to avoid the HAVING clause, whenever possible.&lt;br /&gt;The HAVING clause is used to restrict the result set returned by the&lt;br /&gt;GROUP BY clause. When you use GROUP BY with the HAVING clause, the&lt;br /&gt;GROUP BY clause divides the rows into sets of grouped rows and&lt;br /&gt;aggregates their values, and then the HAVING clause eliminates&lt;br /&gt;undesired aggregated groups. In many cases, you can write your select&lt;br /&gt;statement so, that it will contain only WHERE and GROUP BY clauses&lt;br /&gt;without HAVING clause. This can improve the performance of your query.&lt;br /&gt;&lt;br /&gt;• If you need to return the total table's row count, you can use&lt;br /&gt;alternative way instead of SELECT COUNT(*) statement.&lt;br /&gt;Because SELECT COUNT(*) statement make a full table scan to return the&lt;br /&gt;total table's row count, it can take very many time for the large&lt;br /&gt;table. There is another way to determine the total row count in a&lt;br /&gt;table. You can use sysindexes system table, in this case. There is&lt;br /&gt;ROWS column in the sysindexes table. This column contains the total&lt;br /&gt;row count for each table in your database. So, you can use the&lt;br /&gt;following select statement instead of SELECT COUNT(*): SELECT rows&lt;br /&gt;FROM sysindexes WHERE id = OBJECT_ID('table_name') AND indid &lt; 2 So,&lt;br /&gt;you can improve the speed of such queries in several times.&lt;br /&gt;&lt;br /&gt;• Include SET NOCOUNT ON statement into your stored procedures to stop&lt;br /&gt;the message indicating the number of rows affected by a T-SQL statement.&lt;br /&gt;This can reduce network traffic, because your client will not receive&lt;br /&gt;the message indicating the number of rows affected by a T-SQL statement.&lt;br /&gt;&lt;br /&gt;• Try to restrict the queries result set by using the WHERE clause.&lt;br /&gt;This can results in good performance benefits, because SQL Server will&lt;br /&gt;return to client only particular rows, not all rows from the table(s).&lt;br /&gt;This can reduce network traffic and boost the overall performance of&lt;br /&gt;the query.&lt;br /&gt;&lt;br /&gt;• Use the select statements with TOP keyword or the SET ROWCOUNT&lt;br /&gt;statement, if you need to return only the first n rows.&lt;br /&gt;This can improve performance of your queries, because the smaller&lt;br /&gt;result set will be returned. This can also reduce the traffic between&lt;br /&gt;the server and the clients.&lt;br /&gt;&lt;br /&gt;• Try to restrict the queries result set by returning only the&lt;br /&gt;particular columns from the table, not all table's columns.&lt;br /&gt;This can results in good performance benefits, because SQL Server will&lt;br /&gt;return to client only particular columns, not all table's columns.&lt;br /&gt;This can reduce network traffic and boost the overall performance of&lt;br /&gt;the query.&lt;br /&gt;1.Indexes&lt;br /&gt;2.avoid more number of triggers on the table&lt;br /&gt;3.unnecessary complicated joins&lt;br /&gt;4.correct use of Group by clause with the select list&lt;br /&gt;5 In worst cases Denormalization&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Index Optimization tips&lt;br /&gt;&lt;br /&gt;• Every index increases the time in takes to perform INSERTS, UPDATES&lt;br /&gt;and DELETES, so the number of indexes should not be very much. Try to&lt;br /&gt;use maximum 4-5 indexes on one table, not more. If you have read-only&lt;br /&gt;table, then the number of indexes may be increased.&lt;br /&gt;&lt;br /&gt;• Keep your indexes as narrow as possible. This reduces the size of&lt;br /&gt;the index and reduces the number of reads required to read the index.&lt;br /&gt;&lt;br /&gt;• Try to create indexes on columns that have integer values rather&lt;br /&gt;than character values.&lt;br /&gt;&lt;br /&gt;• If you create a composite (multi-column) index, the order of the&lt;br /&gt;columns in the key are very important. Try to order the columns in the&lt;br /&gt;key as to enhance selectivity, with the most selective columns to the&lt;br /&gt;leftmost of the key.&lt;br /&gt;&lt;br /&gt;• If you want to join several tables, try to create surrogate integer&lt;br /&gt;keys for this purpose and create indexes on their columns.&lt;br /&gt;&lt;br /&gt;• Create surrogate integer primary key (identity for example) if your&lt;br /&gt;table will not have many insert operations.&lt;br /&gt;&lt;br /&gt;• Clustered indexes are more preferable than nonclustered, if you need&lt;br /&gt;to select by a range of values or you need to sort results set with&lt;br /&gt;GROUP BY or ORDER BY.&lt;br /&gt;&lt;br /&gt;• If your application will be performing the same query over and over&lt;br /&gt;on the same table, consider creating a covering index on the table.&lt;br /&gt;&lt;br /&gt;• You can use the SQL Server Profiler Create Trace Wizard with&lt;br /&gt;"Identify Scans of Large Tables" trace to determine which tables in&lt;br /&gt;your database may need indexes. This trace will show which tables are&lt;br /&gt;being scanned by queries instead of using an index.&lt;br /&gt;&lt;br /&gt;• You can use sp_MSforeachtable undocumented stored procedure to&lt;br /&gt;rebuild all indexes in your database. Try to schedule it to execute&lt;br /&gt;during CPU idle time and slow production periods.&lt;br /&gt;sp_MSforeachtable @command1="print '?' DBCC DBREINDEX ('?')"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-1739529744947614437?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/1739529744947614437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=1739529744947614437' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/1739529744947614437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/1739529744947614437'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/06/sql-optimization.html' title='SQL Optimization'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-3576744729895414972</id><published>2009-06-05T22:23:00.000-07:00</published><updated>2009-06-05T23:01:39.401-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><title type='text'>Left Outer Join in LINQ</title><content type='html'>&lt;strong&gt;Left Outer Join in LINQ &lt;/strong&gt; &lt;br /&gt;My example shows how to perform a left join &lt;br /&gt;To do a left outer join, you need use &lt;strong&gt;SelectMany and DefaultIfEmpty&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;DataContext objDb = new DataContext();&lt;br /&gt;            var objSectionInst = (from s in objDb.Sections&lt;br /&gt;                                        join sim in objDb.SectionInstructorMaps on s.SectionId equals sim.SectionId into temp&lt;br /&gt;                                        from t in temp.DefaultIfEmpty()&lt;br /&gt;                                        where s.CourseId == courseId&lt;br /&gt;                                        select new&lt;br /&gt;                                        {&lt;br /&gt;                                            SectionInstructorMapId = = t == null ? "0" : t.SectionInstructorMapId.ToString(),&lt;br /&gt;                                            UserId = = t == null ? "0" : t.UserId.ToString(),&lt;br /&gt;                                            SectionId = = t == null ? "0" : s.SectionId.ToString(),&lt;br /&gt;                                            SectionName = s.Name,&lt;br /&gt;                                            SectionTermName = s.Term.Name,&lt;br /&gt;                                            SectionTermYear = s.TermYear,&lt;br /&gt;                                            UserFullName = t.User.UserName&lt;br /&gt;                                        });&lt;br /&gt;&lt;br /&gt;            grdvInst.DataSource = objSectionInst;&lt;br /&gt;            grdvInst.DataBind();&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-3576744729895414972?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/3576744729895414972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=3576744729895414972' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3576744729895414972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3576744729895414972'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/06/left-outer-join-in-linq.html' title='Left Outer Join in LINQ'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-8851832621784805419</id><published>2009-06-05T21:59:00.000-07:00</published><updated>2009-06-05T22:03:55.330-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JQuery'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Drag and Drop between two lists with jQuery</title><content type='html'>Demo Drag and Drop between two lists with jQuery &lt;br /&gt;&lt;br /&gt;http://thechriswalker.net/select-drag/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-8851832621784805419?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/8851832621784805419/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=8851832621784805419' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/8851832621784805419'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/8851832621784805419'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/06/select-and-drag-demo-jquery.html' title='Drag and Drop between two lists with jQuery'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-3672345946962695308</id><published>2009-05-21T11:13:00.000-07:00</published><updated>2009-05-21T11:16:00.980-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Testing'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Selenium  Testing</title><content type='html'>&lt;strong&gt;Selenium &lt;/strong&gt;is a portable software testing framework for web applications. The tests can be written as HTML tables or coded in a number of popular programming languages and can be run directly in most modern web browsers. Selenium can be deployed on Windows, Linux, and Macintosh.&lt;br /&gt;&lt;br /&gt;Selenium was developed by a team of programmers and testers at ThoughtWorks. It is open source software, released under the Apache 2.0 license and can be downloaded and used without charge. The latest side project is Selenium Grid, which provides a hub allowing the running of multiple Selenium tests concurrently on any number of local or remote systems, thus minimizing test execution time.&lt;br /&gt;&lt;br /&gt;http://seleniumhq.org/&lt;br /&gt;&lt;br /&gt;Selenium IDE is a Firefox add-on that records clicks, typing, and other actions to make a test, which you can play back in the browser.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-3672345946962695308?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/3672345946962695308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=3672345946962695308' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3672345946962695308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3672345946962695308'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/05/selenium-testing.html' title='Selenium  Testing'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-6327305487003574627</id><published>2009-05-13T00:08:00.000-07:00</published><updated>2009-05-13T00:32:38.968-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><title type='text'>LINQ - Using Quantifiers like Any, All and Contains</title><content type='html'>&lt;strong&gt;LINQ - Using Quantifiers like Any, All and Contains while Querying Objects&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Quantifier operations &lt;/strong&gt;return a &lt;strong&gt;Boolean value &lt;/strong&gt;if some or all of the elements in a sequence satisfy a condition. In this article, we will see some common LINQ to Objects scenarios where we can use these operators.&lt;br /&gt;&lt;br /&gt;All – used to determine whether all the elements in a sequence satisfy a condition.&lt;br /&gt;Any - used to determine whether any elements in a sequence satisfy a condition.&lt;br /&gt;Contains - used to determine whether a sequence contains a specified element&lt;br /&gt;&lt;br /&gt;I have created a Department and Employee class. Each Employee belongs to a Department. We will query these objects and retrieve information using LINQ through the quantifiers available to us. Here’s the sample data:&lt;br /&gt;C#&lt;br /&gt;static void Main(string[] args)&lt;br /&gt;{&lt;br /&gt;    List&amp;lt;Department&amp;gt; dept = new List&amp;lt;Department&amp;gt;();&lt;br /&gt;    dept.Add(new Department() { DeptID = 1, DeptName = &amp;quot;Marketing&amp;quot;, Floor = 1 });&lt;br /&gt;    dept.Add(new Department() { DeptID = 2, DeptName = &amp;quot;Sales&amp;quot;, Floor = 2 });&lt;br /&gt;    dept.Add(new Department() { DeptID = 3, DeptName = &amp;quot;Administration&amp;quot;, Floor = 3 });&lt;br /&gt;    dept.Add(new Department() { DeptID = 4, DeptName = &amp;quot;Accounts&amp;quot;, Floor = 3 });&lt;br /&gt;    dept.Add(new Department() { DeptID = 5, DeptName = &amp;quot;HR&amp;quot;, Floor = 3 });&lt;br /&gt;&lt;br /&gt;List&amp;lt;Employee&amp;gt; emp = new List&amp;lt;Employee&amp;gt;(); &lt;br /&gt;    emp.Add(new Employee() { EmpID = 1, DeptID = 1, EmpName = &amp;quot;Saikat&amp;quot;}); &lt;br /&gt;    emp.Add(new Employee() { EmpID = 2, DeptID = 4, EmpName = &amp;quot;Partha&amp;quot; }); &lt;br /&gt;    emp.Add(new Employee() { EmpID = 3, DeptID = 3, EmpName = &amp;quot;Sanjoy&amp;quot; }); &lt;br /&gt;    emp.Add(new Employee() { EmpID = 4, DeptID = 4, EmpName = &amp;quot;Sapan&amp;quot;}); &lt;br /&gt; }&lt;br /&gt; &lt;br /&gt;class Department &lt;br /&gt;{&lt;br /&gt;    public int DeptID { get; set; }&lt;br /&gt;    public string DeptName { get; set; } &lt;br /&gt;    public int Floor { get; set; } &lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;class Employee &lt;br /&gt;{ &lt;br /&gt;    public int EmpID { get; set; } &lt;br /&gt;    public int DeptID { get; set; } &lt;br /&gt;    public string EmpName { get; set; } &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Using ‘Any’ Quantifier in LINQ&lt;/strong&gt;&lt;br /&gt;This sample uses the ‘Any’ operator to list down the Departments that do not have Employees&lt;br /&gt;C#&lt;br /&gt;    var noEmp =&lt;br /&gt;        from d in dept&lt;br /&gt;        where !emp.Any(e =&amp;gt; e.DeptID == d.DeptID)&lt;br /&gt;        select new { dId = d.DeptID, dNm = d.DeptName };&lt;br /&gt; &lt;br /&gt;    Console.WriteLine(&amp;quot;Departments having no Employees&amp;quot;);&lt;br /&gt;    foreach (var empl in noEmp)&lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine(&amp;quot;Dept ID - &amp;quot; + empl.dId + &amp;quot;, Dept Name - &amp;quot; + empl.dNm);&lt;br /&gt; &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Using ‘All’ Quantifier in LINQ&lt;/strong&gt;&lt;br /&gt;Using the ‘All’ operator, we can determine whether all employees have their names starting with ‘A’&lt;br /&gt;C#&lt;br /&gt; Console.WriteLine(&amp;quot;Find if all Employees have their names starting with 'A'&amp;quot;);&lt;br /&gt; bool chkName = emp.All(e =&amp;gt;&lt;br /&gt;                    e.EmpName.StartsWith(&amp;quot;A&amp;quot;));&lt;br /&gt; Console.WriteLine(&amp;quot;Result : &amp;quot; + chkName);&lt;br /&gt; &lt;br /&gt; Console.ReadLine();&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Using ‘Contains’ Quantifier in LINQ&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;The following example uses the ‘Contains’ quantifier to find the List of Departments having Employee Names starting with ‘S’&lt;br /&gt;C#&lt;br /&gt;     // Functionality Similar to IN operator&lt;br /&gt;    var hasEmp = dept&lt;br /&gt;         .Where(e =&amp;gt; emp.Where(contact =&amp;gt;&lt;br /&gt;         contact.EmpName.StartsWith(&amp;quot;S&amp;quot;))&lt;br /&gt;         .Select(d =&amp;gt; d.DeptID)&lt;br /&gt;         .Contains(e.DeptID));&lt;br /&gt; &lt;br /&gt;    Console.WriteLine(&amp;quot;/nList of Departments having Employee Names starting with S&amp;quot;);&lt;br /&gt;    foreach (var dpt in hasEmp)&lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine(&amp;quot;Dept ID - &amp;quot; + dpt.DeptID + &amp;quot;, Dept Name - &amp;quot; + dpt.DeptName);&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    Console.ReadLine();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you want to add another condition to the above query where only Departments in Floor 2 and 3 are to be considered, then here’s how to do so:&lt;br /&gt;C#&lt;br /&gt; List&amp;lt;int&amp;gt; floorNo = new List&amp;lt;int&amp;gt;() {2, 3};&lt;br /&gt; var floo = emp.Where(contact =&amp;gt;&lt;br /&gt;     contact.EmpName.StartsWith(&amp;quot;S&amp;quot;))&lt;br /&gt;    .Where(du =&amp;gt; dept.Where(dp =&amp;gt; floorNo.Contains(dp.Floor))&lt;br /&gt;        .Select(dp =&amp;gt; dp.DeptID)&lt;br /&gt;        .Contains(du.DeptID));&lt;br /&gt; &lt;br /&gt; Console.WriteLine(&amp;quot;List of Employess with Names starting with S\nand are on Floor 2 or 3&amp;quot;);&lt;br /&gt; foreach (var dpt in floo)&lt;br /&gt; {&lt;br /&gt;      Console.WriteLine(&amp;quot;Dept ID - &amp;quot; + dpt.DeptID + &amp;quot;, Employee Name - &amp;quot; + dpt.EmpName);&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; Console.ReadLine();&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-6327305487003574627?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/6327305487003574627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=6327305487003574627' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/6327305487003574627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/6327305487003574627'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/05/linq-using-quantifiers-like-any-all-and.html' title='LINQ - Using Quantifiers like Any, All and Contains'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-4867665121177821741</id><published>2009-05-12T23:56:00.000-07:00</published><updated>2009-05-12T23:58:04.343-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><title type='text'>How to hide or remove GridView headers?</title><content type='html'>How to hide or remove GridView headers&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:GridView ID=&amp;quot;GridView1&amp;quot; runat=&amp;quot;server&amp;quot; ShowHeader=&amp;quot;False&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;/asp:GridView&amp;gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;showheader=false on the aspx page&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-4867665121177821741?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/4867665121177821741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=4867665121177821741' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4867665121177821741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4867665121177821741'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/05/how-to-hide-or-remove-gridview-headers.html' title='How to hide or remove GridView headers?'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-9221210295661653427</id><published>2009-05-03T10:58:00.000-07:00</published><updated>2009-05-16T23:24:53.243-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JQuery'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Basic Jquery</title><content type='html'>&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;jquery.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;example1&lt;br /&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;JQuery basic tutorial&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;jquery.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;$(document).ready(function () {&lt;br /&gt;alert('Works!!!');&lt;br /&gt;} );&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;JQuery basic tutorial&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-9221210295661653427?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/9221210295661653427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=9221210295661653427' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/9221210295661653427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/9221210295661653427'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/05/basic-jquery.html' title='Basic Jquery'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-3038451666201771686</id><published>2009-04-16T01:40:00.000-07:00</published><updated>2009-04-16T02:36:54.143-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Raw HTML to Escaped HTML'/><title type='text'>Convert Raw HTML to Escaped HTML for blog</title><content type='html'>quick escape a tool that lets you quickly paste in HTML and for that to be converted to escaped characters - for example converting &lt;  a  &gt; to &amp;lt;a&amp;gt; - which can then be pasted back in to your HTML source code so that it renders on screen in code samples and the like.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;http://www.accessify.com/tools-and-wizards/developer-tools/quick-escape/default.php&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-3038451666201771686?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/3038451666201771686/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=3038451666201771686' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3038451666201771686'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3038451666201771686'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/04/convert-raw-html-to-escaped-html.html' title='Convert Raw HTML to Escaped HTML for blog'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-4673813643742197094</id><published>2009-04-16T01:23:00.000-07:00</published><updated>2009-04-16T01:31:49.685-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='JQuery'/><title type='text'>Scriptaculous script.aculo.us</title><content type='html'>script.aculo.us is a JavaScript library built on the Prototype JavaScript Framework, providing dynamic visual effects and user interface elements via the Document Object Model.&lt;br /&gt;&lt;br /&gt;It is most notably included with Seaside and Ruby on Rails, but also provided separately to work with other web application frameworks and scripting languages.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;script.aculo.us examples&amp;lt;/title&amp;gt;&lt;br /&gt;&lt;br /&gt;   &amp;lt;script type=&amp;quot;text/javascript&amp;quot; &lt;br /&gt;   src=&amp;quot;/javascript/prototype.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;   &amp;lt;script type=&amp;quot;text/javascript&amp;quot; &lt;br /&gt;   src=&amp;quot;/javascript/scriptaculous.js?load=effects&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;   &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;   function ShrinkEffect(element){&lt;br /&gt;       new Effect.Shrink(element, {duration:3});&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   function ShowImage(element){&lt;br /&gt;       new Effect.Appear(element,{duration:1, from:1, to:1.0});&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   &amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;div onclick=&amp;quot;ShowImage('myimage')&amp;quot;&amp;gt;&lt;br /&gt;    Click me to display the image&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;div id=&amp;quot;myimage&amp;quot; onclick=&amp;quot;ShrinkEffect(this);&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;img src=&amp;quot;/images/scriptaculous.gif&amp;quot; alt=&amp;quot;script.aculo.us&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;h2&amp;gt;Click me to Shrink me out&amp;lt;/h2&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-4673813643742197094?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/4673813643742197094/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=4673813643742197094' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4673813643742197094'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4673813643742197094'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/04/scriptaculous-scriptaculous.html' title='Scriptaculous script.aculo.us'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-7175234473764805862</id><published>2009-04-15T01:51:00.000-07:00</published><updated>2009-04-16T00:10:03.058-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET 2.0'/><title type='text'>How to populate ListBox and DropDownList data with javascript</title><content type='html'>&amp;lt;strong&amp;gt;&lt;br /&gt;&amp;lt; script type=&amp;quot;text/javascript&amp;quot; &amp;gt;&lt;br /&gt;&lt;br /&gt;function add()&lt;br /&gt; {&lt;br /&gt;&lt;br /&gt;AddListBox(&amp;quot;sai&amp;quot;,&amp;quot;1&amp;quot;);&lt;br /&gt;AddListBox(&amp;quot;sai2&amp;quot;,&amp;quot;2&amp;quot;);&lt;br /&gt;AddListBox(&amp;quot;sai3&amp;quot;,&amp;quot;3&amp;quot;);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;function AddListBox(Text,Value)&lt;br /&gt;    {&lt;br /&gt;      var opt = document.createElement(&amp;quot;option&amp;quot;);&lt;br /&gt;        document.getElementById('&amp;lt;% =ListBox1.ClientID%&amp;gt;').options.add(opt);&lt;br /&gt;        opt.text = Text;&lt;br /&gt;        opt.value = Value;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&amp;lt;/ script &amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt; body onLoad=&amp;quot;add()&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt; div&amp;gt;&lt;br /&gt;    &lt;br /&gt;        &amp;lt;asp:ListBox ID=&amp;quot;ListBox1&amp;quot; runat=&amp;quot;server&amp;quot; &amp;gt;&amp;lt;/asp:ListBox&amp;gt;&lt;br /&gt;    &lt;br /&gt;    &amp;lt;/div&amp;gt;&lt;br /&gt;    &amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&amp;lt;/strong&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-7175234473764805862?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/7175234473764805862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=7175234473764805862' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/7175234473764805862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/7175234473764805862'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/04/how-to-populate-listbox-and.html' title='How to populate ListBox and DropDownList data with javascript'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-1434807458937220548</id><published>2009-04-15T01:31:00.000-07:00</published><updated>2009-04-15T01:36:05.606-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Passing parameters to user controls  c# asp.net</title><content type='html'>Passing parameters to user controls c# asp.net&lt;br /&gt;user control:&lt;br /&gt;private string _InstructorFinderSide;&lt;br /&gt;public string InstructorFinderSide&lt;br /&gt;{&lt;br /&gt;get { return _InstructorFinderSide; }&lt;br /&gt;set { _InstructorFinderSide = value; }&lt;br /&gt;}&lt;br /&gt;From within the user control you can simply refer to "InstructorFinderSide" fromthereonin to get the value that was assigned to it by the parent.&lt;br /&gt;&lt;br /&gt;Parent:Two methods&lt;br /&gt;&lt;uc2:instructorfc id="InstructorFinder" runat="server" instructorfinderside="right"&gt;&lt;-uc2:InstructorFC ID="InstructorFinder" InstructorFinderSide="right" runat="server"/&gt;&lt;br /&gt;in codebehind&lt;br /&gt;InstructorFinderSide="right"&lt;br /&gt;&lt;br /&gt;&lt;/uc2:instructorfc&gt;&lt;?xml:namespace prefix = uc2 /&gt;&lt;uc2:instructorfc id="InstructorFinder" runat="server" instructorfinderside="right"&gt;&lt;/uc2:instructorfc&gt;&lt;uc2:instructorfc id="InstructorFinder" runat="server" instructorfinderside="right"&gt;&lt;/uc2:instructorfc&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-1434807458937220548?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/1434807458937220548/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=1434807458937220548' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/1434807458937220548'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/1434807458937220548'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/04/passing-parameters-to-user-controls-c.html' title='Passing parameters to user controls  c# asp.net'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-2154435116530641297</id><published>2009-04-09T11:53:00.000-07:00</published><updated>2009-05-16T23:44:52.325-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='JQuery'/><title type='text'>How to Drag and Drop in JavaScript and jquery</title><content type='html'>&amp;lt;a href=&amp;quot;http://www.webreference.com/programming/javascript/mk/column2/&amp;quot;&amp;gt;http://www.webreference.com/programming/javascript/mk/column2/&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;a href=&amp;quot;http://batiste.dosimple.ch/blog/posts/2008-05-18-1/jquery-drag-and-drop-and-resize-event-delegation.html&amp;quot;&amp;gt;http://batiste.dosimple.ch/blog/posts/2008-05-18-1/jquery-drag-and-drop-and-resize-event-delegation.html&amp;lt;/a&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;a href=&amp;quot;http://fromvega.com/wordpress/2007/07/14/easydrag-jquery-plugin/&amp;quot;&amp;gt;http://fromvega.com/wordpress/2007/07/14/easydrag-jquery-plugin/&amp;lt;/a&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Jquery&lt;br /&gt;&lt;br /&gt;http://thechriswalker.net/select-drag/&lt;br /&gt;&lt;br /&gt;&amp;lt;script language=&amp;quot;javascript&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;$(document).ready(function(){      $(&amp;quot;.block&amp;quot;).draggable({helper:'clone'});              &lt;br /&gt;$(&amp;quot;.drop&amp;quot;).droppable({ accept: &amp;quot;.block&amp;quot;, activeClass: 'droppable-active', hoverClass: 'droppable-hover', drop: function(ev, ui) {   document.getElementById(&amp;quot;display&amp;quot;).innerHTML =  $(ui.draggable).children(&amp;quot;li:first&amp;quot;).text();   &lt;br /&gt;var lid = ($(ui.draggable).children(&amp;quot;li:first&amp;quot;));   &lt;br /&gt;var removeLink = document.createElement(&amp;quot;a&amp;quot;);  &lt;br /&gt;removeLink.innerHTML = &amp;quot;remove&amp;quot;; &lt;br /&gt;removeLink.href = &amp;quot;#&amp;quot;; removeLink.onclick = function()  {           $(&amp;quot;#drop1&amp;quot;).children().remove(&amp;quot;#&amp;quot;+lid[0].id);     &lt;br /&gt; $(this).remove();        }   &lt;br /&gt;$(this).append($(ui.draggable).clone().children(&amp;quot;li:first&amp;quot;).addClass(&amp;quot;blocker&amp;quot;));   &lt;br /&gt;$(this).append(removeLink);   }});   });&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;And here is the HTML:&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml:namespace prefix = asp /&amp;gt;&amp;lt;asp:datalist id=&amp;quot;dlRooms&amp;quot; repeatdirection=&amp;quot;Horizontal&amp;quot; repeatcolumns=&amp;quot;3&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;p&amp;gt;&amp;lt;%# Eval(&amp;quot;tblRoom.Description&amp;quot;) %&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/itemtemplate&amp;gt;&amp;lt;/asp:datalist&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-2154435116530641297?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/2154435116530641297/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=2154435116530641297' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2154435116530641297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2154435116530641297'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/04/how-to-drag-and-drop-in-javascript-and.html' title='How to Drag and Drop in JavaScript and jquery'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-2182292035341889697</id><published>2009-03-29T05:43:00.000-07:00</published><updated>2009-03-29T05:52:01.474-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>ASP.NET Security and Avoid Attack</title><content type='html'>ASP.NET Security and Avoid Attack&lt;br /&gt;&lt;br /&gt;1.Cross-site Scripting (CSS ,XSS)&lt;br /&gt;2.SQL Injection&lt;br /&gt;3.Validate your User Inputs&lt;br /&gt;4.Use Hashing to Store your Passwords&lt;br /&gt;5.Store Secure Information in the Registry&lt;br /&gt;6.Do Some Housekeeping before You Deploy Your Web Application&lt;br /&gt;7.Use Sessions, but Not Cookie-less Sessions&lt;br /&gt;8.Encrypt Sensitive Data&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-2182292035341889697?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/2182292035341889697/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=2182292035341889697' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2182292035341889697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2182292035341889697'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/03/aspnet-security-and-avoid-attack.html' title='ASP.NET Security and Avoid Attack'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-1573566498233672628</id><published>2009-03-29T05:19:00.000-07:00</published><updated>2009-03-29T05:42:06.731-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Common Web application attack types</title><content type='html'>1. SQL Injection -&lt;br /&gt;a security vulnerability that occurs in the database layer of an application&lt;br /&gt;&lt;br /&gt;2. Cross-Site Scripting &lt;br /&gt;&lt;br /&gt;causes a user's Web browser to execute a malicious script&lt;br /&gt;&lt;br /&gt;3. Web site defacement &lt;br /&gt;occurs when a hacker breaks into a web server and alters the hosted website or creates one of his own&lt;br /&gt;&lt;br /&gt;4. Buffer Overflow &lt;br /&gt;&lt;br /&gt;hackers exploit buffer overflows by appending executable&lt;br /&gt;instructions to the end of data and causing that code to be run after it has&lt;br /&gt;entered memory&lt;br /&gt;&lt;br /&gt;5. DOS -Denial Of Service - &lt;br /&gt;&lt;br /&gt;an assault on a network that floods it with so&lt;br /&gt;many additional requests that regular traffic is either slowed or completely&lt;br /&gt;interrupted&lt;br /&gt;&lt;br /&gt;6. Password Cracking &lt;br /&gt;&lt;br /&gt;the process of recovering secret passwords from data&lt;br /&gt;that has been stored in or transmitted by a computer system, typically, by&lt;br /&gt;repeatedly verifying guesses for the password&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In order to eliminate application security problems the developers have to&lt;br /&gt;pay attention to security and have to code securely. In this paper we have&lt;br /&gt;shown that ASP.NET, and now ASP.NET 2.0, integrates a number of defense&lt;br /&gt;mechanisms that can be easily applied:&lt;br /&gt;• Classes for SQL parameters that prevent SQL injection,&lt;br /&gt;• Automatic checking for CSS attack, and&lt;br /&gt;• Custom error pages and centralized exception handling.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-1573566498233672628?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/1573566498233672628/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=1573566498233672628' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/1573566498233672628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/1573566498233672628'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/03/common-web-application-attack-types.html' title='Common Web application attack types'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-4701560341574148970</id><published>2009-03-29T02:40:00.000-07:00</published><updated>2009-03-29T03:37:58.950-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='JQuery'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>JQuery</title><content type='html'>&lt;strong&gt;JQuery &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;JQuery is another javascript library which eases javascript developemt - and it also (of course) includes some Ajax functionality.&lt;br /&gt;&lt;br /&gt;jQuery is a lightweight JavaScript library that emphasizes interaction between JavaScript and HTML. It was released January 2006 at BarCamp NYC by John Resig.&lt;br /&gt;&lt;br /&gt;Dual licensed under the MIT License and the GNU General Public License, jQuery is free, open source software.&lt;br /&gt;&lt;br /&gt;Both Microsoft and Nokia have announced plans to bundle jQuery on their platforms, Microsoft adopting it initially within Visual Studio and use within Microsoft's ASP.NET AJAX framework and ASP.NET MVC Framework whilst Nokia will integrate it into their Web Run-Time platform.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Features&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;jQuery contains the following features:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;DOM element selections &lt;br /&gt;DOM traversal and modification, (including support for CSS 1-3 and basic XPath) &lt;br /&gt;Events &lt;br /&gt;CSS manipulation &lt;br /&gt;Effects and animations &lt;br /&gt;Ajax &lt;br /&gt;Extensibility &lt;br /&gt;Utilities - such as browser version and the each function. &lt;br /&gt;JavaScript Plugins&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-4701560341574148970?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/4701560341574148970/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=4701560341574148970' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4701560341574148970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4701560341574148970'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/03/jquery.html' title='JQuery'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-2313204482723026156</id><published>2009-03-25T12:12:00.000-07:00</published><updated>2009-03-25T12:46:30.322-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Using Stored Procedures in LINQ</title><content type='html'>CREATE PROCEDURE dbo.GetPeople&lt;br /&gt;   AS&lt;br /&gt;   Select PersonId, FirstName, LastName&lt;br /&gt;   From People&lt;br /&gt;   GO&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;    CREATE PROCEDURE dbo.GetPersonByPersonId&lt;br /&gt;&lt;br /&gt;     @PersonId int&lt;br /&gt;&lt;br /&gt;     AS&lt;br /&gt;&lt;br /&gt;     Select PersonId, FirstName, LastName &lt;br /&gt;&lt;br /&gt;     From People&lt;br /&gt;&lt;br /&gt;     Where PersonId = @PersonId&lt;br /&gt;&lt;br /&gt;     Return&lt;br /&gt;&lt;br /&gt;    public class Program {&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;   rivate static string _conn = ConfigurationManager.ConnectionStrings["lin@"].ConnectionString;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;            public static void Main(string[] args) {&lt;br /&gt;&lt;br /&gt;                Blog db = new Blog(_conn);&lt;br /&gt;&lt;br /&gt;                foreach (var person in db.GetPeople()) {&lt;br /&gt;&lt;br /&gt;                    Console.WriteLine("PersonId: {0} Name: {1} {2}", person.PersonId, person.FirstName, person.LastName);&lt;br /&gt;&lt;br /&gt;                }&lt;br /&gt;&lt;br /&gt;                // we maintain the expressiveness of linq&lt;br /&gt;&lt;br /&gt;                var query = from p in db.GetPeople() orderby p.LastName select new {p.FirstName, p.LastName};&lt;br /&gt;&lt;br /&gt;                foreach (var person in query) {&lt;br /&gt;&lt;br /&gt;                    Console.WriteLine("{0}, {1}", person.FirstName, person.LastName);&lt;br /&gt;&lt;br /&gt;                }&lt;br /&gt;&lt;br /&gt;                // calling a sproc which takes an arg&lt;br /&gt;&lt;br /&gt;                var bart = db.GetPersonByPersonId(4).Single();&lt;br /&gt;&lt;br /&gt;                Console.WriteLine("{0} {1}", bart.FirstName, bart.LastName);&lt;br /&gt;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;   }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-2313204482723026156?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/2313204482723026156/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=2313204482723026156' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2313204482723026156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2313204482723026156'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/03/using-stored-procedures-in-linq.html' title='Using Stored Procedures in LINQ'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-1913418339396296919</id><published>2009-03-16T11:10:00.000-07:00</published><updated>2009-05-16T23:26:42.257-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Different accessibility levels defined in .NET</title><content type='html'>&lt;strong&gt;public :&lt;/strong&gt; Access is not restricted.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;protected :&lt;/strong&gt; Access is limited to the containing class or types derived from the containing class.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;internal :&lt;/strong&gt; Access is limited to the current assembly.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;protected internal :&lt;/strong&gt; Access is limited to the current assembly or types derived from the containing class.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;private :&lt;/strong&gt; Access is limited to the containing type. Outside classed can't access private type&lt;br /&gt;&lt;br /&gt;Only one access modifier is allowed for a member or type, except when using the protected internal combination&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-1913418339396296919?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/1913418339396296919/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=1913418339396296919' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/1913418339396296919'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/1913418339396296919'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/03/different-accessibility-levels-defined.html' title='Different accessibility levels defined in .NET'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-4189696148353014341</id><published>2009-03-08T11:07:00.000-07:00</published><updated>2009-05-16T23:29:47.690-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>ModalPopupExtender in AJAX</title><content type='html'>The ModalPopupExtender that this popup is attached to has a hidden TargetControl. The popup can be shown via server in code behind &lt;br /&gt;&lt;br /&gt;&amp;lt;script type='text/javascript'&amp;gt;&lt;br /&gt;    function onCancel() &lt;br /&gt;    {&lt;br /&gt;        window.location = &amp;quot;../Pages/Home.aspx&amp;quot;;&lt;br /&gt;    }&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   '&amp;lt;di v align=&amp;quot;center&amp;quot;&amp;gt;    &lt;br /&gt;         &amp;lt;table align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;tr&amp;gt;&lt;br /&gt;                &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;                &amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;asp:LinkButton ID=&amp;quot;LinkButton1&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Choose the Access Permission&amp;quot;&amp;gt;&amp;lt;/asp:LinkButton&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;div&amp;gt;&lt;br /&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;   &amp;lt;asp:Panel ID=&amp;quot;Panel1&amp;quot; runat=&amp;quot;server&amp;quot; CssClass=&amp;quot;modalPopup&amp;quot; Style=&amp;quot;display: none&amp;quot; Width=&amp;quot;233px&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;br /&amp;gt;&lt;br /&gt;   &amp;lt;br /&amp;gt;&lt;br /&gt;   &amp;lt;asp:Label ID=&amp;quot;Label1&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Access Permission&amp;quot; SkinID=&amp;quot;HeaderLabel&amp;quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;br /&gt;   &amp;lt;br /&amp;gt;&lt;br /&gt;   &amp;lt;br /&amp;gt;&lt;br /&gt;  &amp;lt;asp:Label ID=&amp;quot;Label2&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Access for :&amp;quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;br /&gt;                                    &amp;lt;asp:DropDownList ID=&amp;quot;ddlAccessFor&amp;quot; runat=&amp;quot;server&amp;quot; AutoPostBack=&amp;quot;True&amp;quot; &lt;br /&gt;                                     onselectedindexchanged=&amp;quot;ddlAccessFor_SelectedIndexChanged&amp;quot; Width=&amp;quot;140px&amp;quot;&amp;gt;                                               &lt;br /&gt;                                 &amp;lt;/asp:DropDownList&amp;gt;&lt;br /&gt;   &amp;lt;br /&amp;gt;&lt;br /&gt;   &amp;lt;br /&amp;gt;&lt;br /&gt;   &amp;lt;div align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;asp:Button ID=&amp;quot;CancelButton&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Cancel&amp;quot; /&amp;gt;&lt;br /&gt;   &amp;lt;/div&amp;gt;&lt;br /&gt;   &amp;lt;br /&amp;gt;&lt;br /&gt;   &amp;lt;br /&amp;gt;&lt;br /&gt;   &amp;lt;/asp:Panel&amp;gt;&lt;br /&gt;   &amp;lt;br /&amp;gt;&lt;br /&gt;   &amp;lt;ajaxToolkit:ModalPopupExtender ID=&amp;quot;mdlPopup&amp;quot; runat=&amp;quot;server&amp;quot;        &lt;br /&gt;             TargetControlID=&amp;quot;LinkButton1&amp;quot;     &lt;br /&gt;             PopupControlID=&amp;quot;Panel1&amp;quot;&lt;br /&gt;             BackgroundCssClass=&amp;quot;modalBackground&amp;quot;&lt;br /&gt;             DropShadow=&amp;quot;true&amp;quot;&lt;br /&gt;             CancelControlID=&amp;quot;CancelButton&amp;quot; &lt;br /&gt;             OnCancelScript=&amp;quot;onCancel()&amp;quot;&lt;br /&gt;             /&amp;gt;&lt;br /&gt;   &amp;lt;/div&amp;gt;&lt;br /&gt;    &amp;lt;/td&amp;gt;&lt;br /&gt;            &amp;lt;/tr&amp;gt;&lt;br /&gt;                 &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;                     &amp;lt;asp:Label ID=&amp;quot;lblAccessfor&amp;quot; runat=&amp;quot;server&amp;quot; &amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;br /&gt;                 &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;       &lt;br /&gt;        &amp;lt;/table&amp;gt;&lt;br /&gt;        &amp;lt;table&amp;gt;&lt;br /&gt;            &amp;lt;tr&amp;gt;&lt;br /&gt;                &amp;lt;td align=&amp;quot;left&amp;quot; &amp;gt;&lt;br /&gt;                    &amp;lt;asp:Label ID=&amp;quot;lblFaculty&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Faculty :&amp;quot; Visible=&amp;quot;False&amp;quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;br /&gt;                &amp;lt;/td&amp;gt;&lt;br /&gt;                &amp;lt;td align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;                    &amp;lt;asp:DropDownList ID=&amp;quot;ddlFaculty&amp;quot; runat=&amp;quot;server&amp;quot; AutoPostBack=&amp;quot;True&amp;quot; &lt;br /&gt;                        onselectedindexchanged=&amp;quot;ddlFaculty_SelectedIndexChanged&amp;quot; Visible=&amp;quot;False&amp;quot; &lt;br /&gt;                        Width=&amp;quot;280px&amp;quot;&amp;gt;&lt;br /&gt;                        &amp;lt;asp:ListItem Value=&amp;quot;0&amp;quot;&amp;gt;-Select Faculty-&amp;lt;/asp:ListItem&amp;gt;&lt;br /&gt;                    &amp;lt;/asp:DropDownList&amp;gt;&lt;br /&gt;                &amp;lt;/td&amp;gt;&lt;br /&gt;            &amp;lt;/tr&amp;gt;    &lt;br /&gt;            &amp;lt;tr&amp;gt;&lt;br /&gt;                &amp;lt;td align=&amp;quot;left&amp;quot; &amp;gt;&lt;br /&gt;                &amp;lt;asp:Label ID=&amp;quot;lblDepartment&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Department :&amp;quot; Visible=&amp;quot;False&amp;quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;                &lt;br /&gt;                &amp;lt;/td&amp;gt;&lt;br /&gt;                 &amp;lt;td align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;                     &amp;lt;asp:DropDownList ID=&amp;quot;ddlDepartment&amp;quot; runat=&amp;quot;server&amp;quot; AutoPostBack=&amp;quot;True&amp;quot; &lt;br /&gt;                         onselectedindexchanged=&amp;quot;ddlDepartment_SelectedIndexChanged&amp;quot; &lt;br /&gt;                         Visible=&amp;quot;False&amp;quot; Width=&amp;quot;280px&amp;quot;&amp;gt;&lt;br /&gt;                         &amp;lt;asp:ListItem Value=&amp;quot;0&amp;quot;&amp;gt;-Select Department-&amp;lt;/asp:ListItem&amp;gt;&lt;br /&gt;                     &amp;lt;/asp:DropDownList&amp;gt;&lt;br /&gt;                &amp;lt;/td&amp;gt;&lt;br /&gt;            &amp;lt;/tr&amp;gt;&lt;br /&gt;            &amp;lt;tr&amp;gt;&lt;br /&gt;                &amp;lt;td align=&amp;quot;left&amp;quot; &amp;gt;&lt;br /&gt;                &amp;lt;asp:Label ID=&amp;quot;lblAbbreviation&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Abbreviation :&amp;quot; &lt;br /&gt;                        Visible=&amp;quot;False&amp;quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;br /&gt;                &amp;lt;/td &amp;gt;&lt;br /&gt;                &amp;lt;td align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;                    &amp;lt;asp:DropDownList ID=&amp;quot;ddlAbbreviation&amp;quot; runat=&amp;quot;server&amp;quot; AutoPostBack=&amp;quot;True&amp;quot; &lt;br /&gt;                        onselectedindexchanged=&amp;quot;ddlAbbreviation_SelectedIndexChanged&amp;quot; &lt;br /&gt;                        Visible=&amp;quot;False&amp;quot; Width=&amp;quot;180px&amp;quot;&amp;gt;&lt;br /&gt;                        &amp;lt;asp:ListItem Value=&amp;quot;0&amp;quot;&amp;gt;-Select Abbreviation-&amp;lt;/asp:ListItem&amp;gt;&lt;br /&gt;                    &amp;lt;/asp:DropDownList&amp;gt;                    &lt;br /&gt;                &amp;lt;/td&amp;gt;&lt;br /&gt;            &amp;lt;/tr&amp;gt;&lt;br /&gt;            &amp;lt;/table&amp;gt;&lt;br /&gt;        &amp;lt;/div&amp;gt;   &lt;br /&gt;&lt;br /&gt;http://www.asp.net/ajax/ajaxcontroltoolkit/samples/modalpopup/modalpopup.aspx&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-4189696148353014341?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/4189696148353014341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=4189696148353014341' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4189696148353014341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4189696148353014341'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/03/modalpopupextender-in-ajax.html' title='ModalPopupExtender in AJAX'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-8942326360714020549</id><published>2009-03-02T11:44:00.000-08:00</published><updated>2009-03-25T12:08:28.310-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Full Text Search in SQL Server 2005</title><content type='html'>Full text search is the search functionality that enables a fast and easy way of searching text based data in SQL Server.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Full-Text Search Queries&lt;/strong&gt;&lt;br /&gt;For samples on full-text search, created a table named Documents.&lt;br /&gt;&lt;br /&gt;CREATE TABLE Documents(&lt;br /&gt;[DocumentId] [int] IDENTITY(1,1) NOT NULL,&lt;br /&gt;[Title] [nvarchar](1000) NOT NULL,&lt;br /&gt;[Text] [nvarchar](max) NULL,&lt;br /&gt;[FullText] [ntext] NULL,&lt;br /&gt;&lt;br /&gt;CONSTRAINT PK_Documents PRIMARY KEY CLUSTERED&lt;br /&gt;(&lt;br /&gt;[DocumentId] ASC&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;Then created the full-text catalog named FTCatalog&lt;br /&gt;&lt;br /&gt;CREATE FULLTEXT CATALOG FTCatalog &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Enabled the fulltext indexing by running the sp_fulltext_database &lt;br /&gt;&lt;br /&gt;exec sp_fulltext_database 'enable' &lt;br /&gt;&lt;br /&gt;Then created the full-text index on table Documents&lt;br /&gt;&lt;br /&gt;CREATE FULLTEXT INDEX ON Documents&lt;br /&gt;(&lt;br /&gt;Title,&lt;br /&gt;[Text],&lt;br /&gt;[FullText]&lt;br /&gt;)&lt;br /&gt;KEY INDEX PK_Documents ON WorksFTCatalog&lt;br /&gt;WITH CHANGE_TRACKING AUTO&lt;br /&gt;&lt;br /&gt;Creating the fulltext index will return a warning message:&lt;br /&gt;&lt;br /&gt;Warning: Table or indexed view 'Documents' has full-text indexed columns that are of type image, text, or ntext. Full-text change tracking cannot track WRITETEXT or UPDATETEXT operations performed on these columns.&lt;br /&gt;&lt;br /&gt;After the population status is set to idle after the indexing has finished by running the below FULLTEXTCATALOGPROPERTY select query,&lt;br /&gt;&lt;br /&gt;SELECT FULLTEXTCATALOGPROPERTY('WorksFTCatalog', 'Populatestatus') &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;We can now run our first search query on the documents table.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;CONTAINS&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;SELECT * FROM Documents WHERE CONTAINS(Text, N'songs') &lt;br /&gt;This query will return me rows that the [Text] columns containing the word "songs".&lt;br /&gt;&lt;br /&gt;But when I run "SELECT * FROM Documents WHERE CONTAINS(Text, N'song')", this query will return me no rows. Since the [Text] column values does not contain the word "song" but contains the word "songs"&lt;br /&gt;&lt;br /&gt;If you wish to search for more than one words you can use OR. But the syntax changes a little bit: N' "songs" OR "song" '&lt;br /&gt;&lt;br /&gt;SELECT * FROM Documents WHERE CONTAINS(Text, N' "songs" OR "song" '); &lt;br /&gt;The character "*" can be used for zero or more any characters. So I can get any words with containing "song" in it.&lt;br /&gt;&lt;br /&gt;SELECT * FROM Documents WHERE CONTAINS(Text, N' "song*" '); &lt;br /&gt;The below sample query will search for all rows where Text column contains words of the form "song", like "songs", etc.&lt;br /&gt;&lt;br /&gt;SELECT * FROM Documents&lt;br /&gt;WHERE CONTAINS(Text, N' FORMSOF (INFLECTIONAL, song) '); &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;FREETEXT&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The following query will find the given search criterias in a text "By alerting you to potentially unsafe attachments, ...". This query will search for all rows containing the words related with ones in the search terms.&lt;br /&gt;&lt;br /&gt;SELECT * FROM Documents&lt;br /&gt;WHERE FREETEXT(Text, N'safe potential attachment'); &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;CONTAINSTABLE&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;CONTAINSTABLE has the functionality of ranking within our searches.&lt;br /&gt;&lt;br /&gt;SELECT *&lt;br /&gt;FROM Documents&lt;br /&gt;INNER JOIN CONTAINSTABLE(Documents, [Text], 'songs') AS KEY_TBL&lt;br /&gt;ON Documents.DocumentId = KEY_TBL.[KEY] &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The last two columns in the result set that are named as "KEY" and "RANK" are from ContainsTable command table KEY_TBL&lt;br /&gt;&lt;br /&gt;Key is the primary key value on the Documents table. And Rank is the search rank for the search term in the related row. Run the ContainsTable part alone.&lt;br /&gt;&lt;br /&gt;SELECT * FROM CONTAINSTABLE(Documents, [Text], 'songs') AS KEY_TBL&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-8942326360714020549?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/8942326360714020549/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=8942326360714020549' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/8942326360714020549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/8942326360714020549'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/03/full-text-search-in-sql-server-2005.html' title='Full Text Search in SQL Server 2005'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-1797350488443711182</id><published>2009-02-22T11:07:00.000-08:00</published><updated>2009-03-25T11:19:59.322-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Ajax Tab Control</title><content type='html'>ASP.NET AJAX Control which creates a set of Tabs that can be used to organize page content. A TabContainer is a host for a number of TabPanel controls. &lt;br /&gt;&lt;br /&gt;Each TabPanel defines its HeaderText or HeaderTemplate as well as a ContentTemplate that defines its content. The most recent tab should remain selected after a postback, and the Enabled state of tabs should remain after a postback as well. &lt;br /&gt;&lt;br /&gt;&lt; ajax Toolkit:TabContainer runat="server" &lt;br /&gt;        OnClientActiveTabChanged="ClientFunction" &lt;br /&gt;        Height="150px"&gt;&lt;br /&gt;    &lt; ajax Toolkit:TabPanel runat="server" &lt;br /&gt;        HeaderText="Signature and Bio"&lt;br /&gt;        &lt;ContentTemplate&gt;&lt;br /&gt;            ...&lt;br /&gt;        &lt;/ContentTemplate&gt;&lt;br /&gt;    /&gt;&lt;br /&gt;&lt;/ ajax Toolkit:TabContainer&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-1797350488443711182?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/1797350488443711182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=1797350488443711182' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/1797350488443711182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/1797350488443711182'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/02/ajax-tab-control.html' title='Ajax Tab Control'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-4487661068252730842</id><published>2009-02-20T11:24:00.000-08:00</published><updated>2009-03-12T12:15:28.923-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Testing'/><title type='text'>Test Driven Development (TDD)</title><content type='html'>&lt;a style="FONT-WEIGHT: bold" href="http://en.wikipedia.org/wiki/Test-driven_development"&gt;Test Driven Development&lt;/a&gt;&lt;br /&gt;Is an approach to design better software. Test Driven Development (TDD) starts the development cycle with gathering requirements, but then quickly moving to writing test cases that document the requirement and force the designer to think about exactly what the system is supposed to do. It takes automated unit testing and regression testing and makes them a basis for all development activities. This means that when adding new functionality a test is written first, it will fail this test at first, then as it is implemented it will eventually pass the test. The best part is now refactoring can take place because we have regression testing already in place to verify by refactoring that we did not break anything. This promotes clean, clear, modularized code because if you can test the code it is likely that it is modular and easier to maintain.&lt;br /&gt;&lt;br /&gt;TDD Advantages Some TDD advantages are as following:&lt;br /&gt;Safe Refactoring When you use TDD, because you have tests already written, you can easily refactor your existing code and you can still be sure that your code does what it needs to be doing, because you have tests.&lt;br /&gt;More Testable Software Design As explained in the refactoring section, TDD helps you design your software for testability, so it will be loosely coupled and more maintainable.&lt;br /&gt;You will have more modularized, flexible, and extensible code which guarantees the Code Quality.&lt;br /&gt;Automated Testing After you created the tests, you can run all the tests at the same time, also you can use some tools like CruiseControl.Net to automate the tests.&lt;br /&gt;Automated Testing significantly reduces the time taken to retest the existing functionality for each new build of the system.&lt;br /&gt;Change Cost Reduced The reason is you have tests, so the change you make has very controllable effect on your system, though it depends on the type of change. In the other words, the Developer will have more confidence on making the decisions and applying the changes.&lt;br /&gt;Greater Reliability &amp;amp; Reduced Debugging Time The reason is you have tests to cover all the production code, so the bugs are caught in the Testing Framework.&lt;br /&gt;Test Cases as Documentation It is very important that the developer has a clear understanding of the specifications and requirements as TDD is applied and the fact is the test cases will be gradually a good source of documentation for your software functionalities.&lt;br /&gt;Requirements Better Detailed TDD helps better understanding of the requirements, analysis and design because the developer cannot create the production code without truly understanding what the desired result should be and how to use it and this approach is done in an iterative manner.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;TestFixture Attribute&lt;/strong&gt;&lt;br /&gt;The TestFixture attribute is used to indicate that a class contains test methods. When you attach this attribute to a class in your project, the Test Runner application will scan it for test methods. The following code illustrates the usage of this attribute. (All of the code in this article is in C#, but NUnit will work with any .NET language, including VB.NET. See the NUnit documentation for additional information.)&lt;br /&gt;&lt;br /&gt;namespace UnitTestingExamples&lt;br /&gt;{&lt;br /&gt;using System;&lt;br /&gt;using NUnit.Framework;&lt;br /&gt;[TestFixture]&lt;br /&gt;public class SomeTests&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The only restrictions on classes that use the TestFixture attribute are that they must have a public default constructor (or no constructor which is the same thing).&lt;br /&gt;&lt;br /&gt;Test AttributeThe Test attribute is used to indicate that a method within a test fixture should be run by the Test Runner application. The method must be public, return void, and take no parameters or it will not be shown in the Test Runner GUI and will not be run when the Test Fixture is run. The following code illustrates the use of this attribute:&lt;br /&gt;&lt;br /&gt;namespace UnitTestingExamples&lt;br /&gt;{&lt;br /&gt;using System;&lt;br /&gt;using NUnit.Framework;&lt;br /&gt;[TestFixture]&lt;br /&gt;public class SomeTests&lt;br /&gt;{&lt;br /&gt;[Test]&lt;br /&gt;public void TestOne()&lt;br /&gt;{&lt;br /&gt;// Do something...&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;SetUp &amp;amp; Teardown Attributes&lt;/p&gt;&lt;p&gt;Sometimes when you are putting together Unit Tests, you have to do a number of things, before or after each test. You could create a private method and call it from each and every test method, or you could just use the Setup and Teardown attributes. These attributes indicate that a method should be executed before (SetUp) or after (Teardown) every test method in the Test Fixture. The most common use for these attributes is when you need to create dependent objects (e.g., database connections, etc.). This example shows the usage of these attributes:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-4487661068252730842?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/4487661068252730842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=4487661068252730842' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4487661068252730842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4487661068252730842'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/02/test-driven-development.html' title='Test Driven Development (TDD)'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-4218050379809713794</id><published>2009-02-20T05:17:00.000-08:00</published><updated>2009-03-11T12:26:47.982-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET Framework 4.0'/><title type='text'>Next version of .NET Framework</title><content type='html'>.NET Framework 4.0 will be the next version of .NET Framework and VSTS2010 (code-named “Rosario”) uses it.It continues to deliver on the core developer experience by speeding up the day-to-day process for development teams. ALM (Application Life Cycle Management) uses Visual Studio 2010 and the .NET Framework 4.0.&lt;br /&gt;&lt;br /&gt;Microsoft is making a commitment to make parallel development accessible to a wide range of developers with Visual Studio 2010:&lt;br /&gt;&lt;br /&gt;• Visual Studio IDE support for Parallel development&lt;br /&gt;• Native C++ libraries and compiler support for Parallel applications&lt;br /&gt;• .NET Framework 4.0 with P-LINQ and parallel language semantics and framework components&lt;br /&gt;&lt;br /&gt;Visual Studio 2010 also includes a Parallel-capable performance analyzer that enables you to extensively instrument code to see the concurrency issues in applications.&lt;br /&gt;&lt;br /&gt;VS2010 will offer features like multi-monitor support, richer code editing and richer code visualization.also Visual Studio 2010 and the .NET Framework 4.0 will include programming models for adding parallel programming for multi core processers.You can download VS 2010 and .NET 4.0 (CTP) from here&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-4218050379809713794?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/4218050379809713794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=4218050379809713794' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4218050379809713794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4218050379809713794'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/02/next-version-of-net-framework.html' title='Next version of .NET Framework'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-347948896631767976</id><published>2009-02-15T06:33:00.000-08:00</published><updated>2009-03-29T06:44:27.848-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET Framework 4.0'/><title type='text'>What's New in the .NET Framework  4.0</title><content type='html'>· Next versions of Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF) will provide better support for Web 2.0 technologies like REST, POX, ATOM.&lt;br /&gt;&lt;br /&gt;· Performance and Scalability of WCF and WF are expected to increase by minimum 10X.&lt;br /&gt;&lt;br /&gt;· New workflow models.&lt;br /&gt;&lt;br /&gt;· Seamless integration between WCF and WF including a new Visual Designer.&lt;br /&gt;&lt;br /&gt;· Parallel Programming framework using PLINQ, Task Parallel Library and Coordination Data Structures to better utilize power of multi-processor and multi-core machines.&lt;br /&gt;&lt;br /&gt;· Build declarative applications with WF, WCF and WPF using XAML. So, XAML is no more only for WPF and WF.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. WCF enhancements :&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt; &lt;strong&gt;1.1 RESTful enhancements&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;   1.1.1 Simplifying the building of REST Singleton &amp; Collection Services, ATOM Feed and Publishing Protocol Services, and HTTP Plain XML Services using WCF&lt;br /&gt;&lt;br /&gt; WCF REST Starter Kit to be released on Codeplex to get early feedback&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;o Messaging enhancements&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt; Transports - UDP, MQ, Local in-process &lt;br /&gt;&lt;br /&gt; Protocols - SOAP over UDP, WS-Discovery, WS-BusinessActivity, WS-I BP 1.2&lt;br /&gt;&lt;br /&gt; Duplex durable messaging&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;o Correlation enhancements&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt; Content and context driven, One-way support&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;o Declarative Workflow Services &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt; Seamless integration between WF and WCF and unified XAML model&lt;br /&gt;&lt;br /&gt; Build entire application in XAML, from presentation to data to services to workflow&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;· WF enhancements :&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;o Significant improvements in performance and scalability&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt; Ten-fold improvement in performance&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;o New workflow flow-control models and pre-built activities&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt; Flowcharts, rules&lt;br /&gt;&lt;br /&gt; Expanded built-in activities – PowerShell, database, messaging, etc.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;o Enhancements in workflow modeling&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt; Persistence control, transaction flow, compensation support, data binding and scoping&lt;br /&gt;&lt;br /&gt; Rules composable and seamlessly integrated with workflow engine&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;o Updated visual designer&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt; Easier to use by end-users &lt;br /&gt;&lt;br /&gt; Easier to rehost by ISVs&lt;br /&gt;&lt;br /&gt; Ability to debug XAML&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-347948896631767976?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/347948896631767976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=347948896631767976' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/347948896631767976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/347948896631767976'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/02/whats-new-in-net-framework-40.html' title='What&apos;s New in the .NET Framework  4.0'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-521873497004765362</id><published>2009-02-12T10:59:00.000-08:00</published><updated>2009-03-12T11:20:24.599-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><title type='text'>Regex Regular Expressions in ASP.NET</title><content type='html'>Regular expressions are a good way to validate text fields such as names, addresses, phone numbers, and other user information. To validate input captured with server controls, you can use the RegularExpressionValidator control.&lt;br /&gt;To validate other forms of input, such as query strings, cookies, and HTML control input, you can use the System.Text.RegularExpressions.Regex class.&lt;br /&gt;&lt;strong&gt;Using the Regex Class&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;1)Add a using statement to reference the System.Text.RegularExpressions namespace.&lt;br /&gt;2)Call the IsMatch method of the Regex class, as shown in the following example.&lt;br /&gt;// Instance method:&lt;br /&gt;Regex reg = new Regex(@"^[a-zA-Z'.]{1,40}$");&lt;br /&gt;Response.Write(reg.IsMatch(txtName.Text));&lt;br /&gt;// Static method:&lt;br /&gt;if (!Regex.IsMatch(txtName.Text,   @"^[a-zA-Z'.]{1,40}$"))&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Regex regex = new Regex(@"&lt;br /&gt;^ # anchor at the start&lt;br /&gt;(?=.*\d) # must contain at least one numeric character&lt;br /&gt;(?=.*[a-z]) # must contain one lowercase character&lt;br /&gt;(?=.*[A-Z]) # must contain one uppercase character&lt;br /&gt;.{8,10} # From 8 to 10 characters in length&lt;br /&gt;\s # allows a space&lt;br /&gt;$ # anchor at the end",&lt;br /&gt;RegexOptions.IgnorePatternWhitespace);&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Trimming a String&lt;/strong&gt;&lt;br /&gt;string initialText = “abc-12-xyz-786″;&lt;br /&gt;System.Text.RegularExpressions.Regex noNumbers = new System.Text.RegularExpressions.Regex (@”\D”);&lt;br /&gt;String numbersOnly = noNumbers.Replace (initialText, String.Empty);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-521873497004765362?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/521873497004765362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=521873497004765362' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/521873497004765362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/521873497004765362'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/02/regex-regular-expressions-in-aspnet.html' title='Regex Regular Expressions in ASP.NET'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-2259671321084303268</id><published>2009-02-11T04:32:00.000-08:00</published><updated>2009-03-11T12:18:43.720-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET Framework 4.0'/><title type='text'>ASP.Net 2010</title><content type='html'>Next generation of developer tool from Microsoft is available now (CTP version) Some Links for ASP.Net 2010(4.0) explaining about the features of .NET Framework 4.0&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/vs2008/products/cc948977.aspxhttp://www.codeproject.com/KB/cs/concept_ide.aspxhttp://blogs.msdn.com/somasegar/archive/2008/09/29/what-s-next-for-visual-studio-and-net-fx.aspx"&gt;http://msdn.microsoft.com/en-us/vs2008/products/cc948977.aspxhttp://www.codeproject.com/KB/cs/concept_ide.aspxhttp://blogs.msdn.com/somasegar/archive/2008/09/29/what-s-next-for-visual-studio-and-net-fx.aspx&lt;/a&gt;&lt;br /&gt;You can also download the Beta Version of ASP.Net 2010(v4.0).&lt;br /&gt;&lt;a href="https://connect.microsoft.com/VisualStudio/content/content.aspx?ContentID=9790"&gt;https://connect.microsoft.com/VisualStudio/content/content.aspx?ContentID=9790&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-2259671321084303268?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/2259671321084303268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=2259671321084303268' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2259671321084303268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2259671321084303268'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/02/aspnet-2010.html' title='ASP.Net 2010'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-3101141900183035871</id><published>2009-02-10T04:59:00.000-08:00</published><updated>2009-03-11T05:03:44.631-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>SQL Server 2008 New Features</title><content type='html'>&lt;p&gt;&lt;br /&gt;Microsoft SQL Server 2008 is at the heart of a comprehensive data platform that enables you to access and manipulate business-critical data from a variety of diverse devices, platforms, and data services across the enterprise.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Top New Features&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Map data structures to business entities by using the new ADO.NET Entity Framework&lt;/p&gt;&lt;p&gt;Use consistent syntax to query diverse data through .NET Language Integrated Query (LINQ) extensions to Microsoft Visual C# and Microsoft Visual Basic.NET&lt;/p&gt;&lt;p&gt;Create occasionally connected solutions using SQL Server 2008 Compact Edition and Microsoft Synchronization Services&lt;/p&gt;&lt;p&gt;Consolidate data storage through the SQL Server 2008 support for relational, XML, Filestream, and geo-location-based data&lt;/p&gt;&lt;p&gt;Get your hands on&lt;/p&gt;&lt;p&gt;http://www.microsoft.com/sqlserver/2008/en/us/app-dev.aspx&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-3101141900183035871?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/3101141900183035871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=3101141900183035871' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3101141900183035871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3101141900183035871'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/02/sql-server-2008-new-features.html' title='SQL Server 2008 New Features'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-8432181841952164749</id><published>2009-02-08T04:45:00.000-08:00</published><updated>2009-03-29T04:54:06.066-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><title type='text'>.NET Framework 3.5 New Features</title><content type='html'>&lt;strong&gt;Microsoft Pre-release Software Visual Studio Code Name "Orcas" - March 2007 Community Technology Preview (CTP)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;NET Framework 3.5 New Features&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Faster .NET Framework execution&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;1. Faster garbage collection&lt;br /&gt;&lt;br /&gt;2. Smarter, faster NGen requiring smaller working set RAM&lt;br /&gt;&lt;br /&gt;3. 64 bit client improvements&lt;br /&gt;&lt;br /&gt;4. ThreadPool performance improvements&lt;br /&gt;&lt;br /&gt;5. Security check caching during NGen &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Base Class Library – New Class Additions&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;6. BigInteger, HashSet and DateTime2 types&lt;br /&gt;&lt;br /&gt;7. NSA Suite ”B” and FIPs compliant cryptography&lt;br /&gt;&lt;br /&gt;8. Lightweight Reader/Writer Lock Classes&lt;br /&gt;&lt;br /&gt;9. Anonymous and Named Pipes IO Classes&lt;br /&gt;&lt;br /&gt;10. Integration with Event Tracing for Windows&lt;br /&gt;&lt;br /&gt;11. New Addin hosting model for extensibility &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Language Integrated Query (LINQ)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Deep integration of LINQ data-awareness into the programming languages and framework.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Workflow Enabled Services – Process and Messaging together&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Using workflow to provide for durable and long-running services. New Tools, WF activities and new programming model classes have been added to simplify building workflow-enabled services using WF and WCF. This allows a .NET Framework developer to build business logic for a service using WF and expose messaging from that service using WCF. These improvements not only provide tools for this scenario but they reduce the amount of glue code that was previously required.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Web 2.0 Friendly and AJAX Enabled WCF Services&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Ajax is a web development technique for making asynchronous exchanges of small amounts of data between browser and web service calls from the browser client script to the web server. A programming model is provided for building Ajax style web applications using WCF services. An HTTP programming model is also provided allowing for REST style web services.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Visual Studio Developer Tools for WF, WCF and in Visual Studio “Orcas”&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Visual Studio”Orcas” has built in tools for web service authoring with WCF and for building workflow enabled software with WF. There are new project templates for WCF services, WF business logic, workflow enabled services, and AJAX services. The templates are conveniently set up to compile and run even before any custom code is added enabling .NET developers to get going quickly. There are also numerous other tools for developing with WF, WCF and WPF. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;More WS-* Standards Support&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Implementation in WCF of the latest OASIS specifications Web Services Atomic Transaction (WS-AtomicTransaction) 1.1, WS-ReliableMessaging 1.1, WS-SecureCOnversation and Web Services Coordination (WS-Coordination) 1.1. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;RSS and ATOM Syndication API&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Applications built using WCF will be able to easily expose syndicated data which can be consumed by an RSS or ATOM reader. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Partial Trust Support for WCF Hosting&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Partial trust on the vlient is provided for ASMX parity focussing mainly on partially trusted WCF applications deployed through click-once. Support is provided for basic HTTP binding provided that the application runs in the Internet zone permissions and have granted the apropriate WebPermission. Secure communication is possible through transport security only. All other features are not available to partially trusted applications including hosting services, duplex communications, non-HTTP transports, WS-* protocols and any WF use. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Rules Data Improvements&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The rules engine in WF is improved to add support for C# 3.0 extension metods, and for operator overloading . Also the ”new” operator is added to compete the base set of expression types. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Built-in WPF tools for Visual Studio “Orcas”&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The Visual Studio designer for WPF was previously released as a CTP. It is not integrated into the development environment and is significantly improved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Additional WPF Features and Improved Performance&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;WPF has smoother animations, faster startup and better overall performance. There are also new data types available for data binding with LINQ. Better integration support is now provided for with codename “WPF/E”.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-8432181841952164749?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/8432181841952164749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=8432181841952164749' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/8432181841952164749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/8432181841952164749'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/02/net-framework-35-new-features.html' title='.NET Framework 3.5 New Features'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-1416747883831606832</id><published>2009-01-29T03:48:00.000-08:00</published><updated>2009-03-29T03:56:36.263-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>New Features in C#  3.0</title><content type='html'>&lt;strong&gt;What's New in CSharp 3.0&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Implicitly Typed Local Variables &lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Local variables can be declared as type ‘var’ which means compiler to determine the actual type based on the data by which its is initialized. &lt;br /&gt;var i = 10; // i is created of type int &lt;br /&gt;var name = “MyName” ; // name is created of type string &lt;br /&gt;can only be used when declared and initialized in same statement. &lt;br /&gt;Cannot be initialized to null. &lt;br /&gt;Cannot be used as class members. &lt;br /&gt;Mostly used to store anonymous types as in LINQ based programming.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Object &amp; Collection Initializers &lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Allow assigning values to any accessible members or properties of a type at the time of initiation without invoking the constructor with parameters. &lt;br /&gt;The default constructor gets executed before assigning the values. &lt;br /&gt;E.g. Coordinate c1 = new Coordinate {x=1 , y=2}; &lt;br /&gt;Used in LINQ query expressions along with anonymous types. &lt;br /&gt;Collection Initializers use Object Initializers to specify multiple elements of collection without calling Add method multiple times.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Extension Methods&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Allows adding new methods to existing types without modifying the existing type. &lt;br /&gt;Are special kind of static methods but are called as if they are instance methods. &lt;br /&gt;The first parameter passed to Extension methods specifies to which type they operate on preceded by ‘this’ keyword. &lt;br /&gt;They cannot access the private variables of type which they are extending. &lt;br /&gt;Extension Methods need to defined in a non-nested and non-generic static class. &lt;br /&gt;Instance methods take priority over extension methods in case they have same signature.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Anonymous Types &lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Are of class types which can have only public read-only properties as their members. No other class members like methods are allowed. &lt;br /&gt;They are of reference types and are derived from ‘Object’ class. &lt;br /&gt;Internally compiler gives them the name but its not accessible by application code. &lt;br /&gt;They have a method scope. &lt;br /&gt;Can be initiated directly e.g. new { property1=1, property2=”Hello World”};&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Lambda Expressions&lt;/em&gt; &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Very similar to anonymous methods introduced in C# 2.0. &lt;br /&gt;Its an inline expression or statement block which can be used to pass arguments to method call or assign value to delegate. &lt;br /&gt;All lambda expression use lambda operator =&gt; where the left side denotes result and right contains statement block or expression.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Auto-Implemented Properties&lt;/em&gt;&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;Helps in simplifying property declaration in cases where there is no custom logic required in accessors methods. &lt;br /&gt;E.g. public int Price {get; set;}; &lt;br /&gt;Internally compiler creates an anonymous field for assigning values.&lt;br /&gt;In my next post on this i will demonstrate these using a code sample.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-1416747883831606832?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/1416747883831606832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=1416747883831606832' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/1416747883831606832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/1416747883831606832'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/01/new-features-in-c-30.html' title='New Features in C#  3.0'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-7885917317546072643</id><published>2009-01-20T04:35:00.000-08:00</published><updated>2009-03-29T04:43:07.702-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><title type='text'>New in .NET Framework 3.5</title><content type='html'>&lt;strong&gt;What's New in .NET Framework 3.5:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;1.) CLR Enhancements: Although the CLR uses the same model as 2.0 improvements/changes to the assemblies.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2.) Compiler Enhancements: New VB.NET 9.0 compiler and support for changes to C# 3.0 like expression trees, lambda methods, extension methods, static reference for anonymous types etc.&lt;br /&gt;&lt;br /&gt;3.) LINQ: Probably the most revolutionary change in the 3.5 framework. LINQ to XML, LINQ to SQL, LINQ to Objects and LINQ to Datasets. Along with functional programming, LINQ is an outlook change to programming in C#.&lt;br /&gt;&lt;br /&gt;4.) Performance Improvements: Quite a few performance improvements have been made in 3.5. ADO.NET gets paging support as well as synchronization from caches at local and server datastores. Also performance improvements for multicore CPUs&lt;br /&gt;&lt;br /&gt;5.) Networking changes: Peer-to-peer networking stack, including a managed PNRP resolver.&lt;br /&gt;&lt;br /&gt;6.) Windows Information APIs: New wrappers for WMI and Active Directory Services. WMI 2.0 gets a managed provider.&lt;br /&gt;&lt;br /&gt;7.) ASP.NET: New implementation of Client Application Services as well as 3 new ASP.NET controls. Also AJAX programming for ASP.NET is easier and better performing.&lt;br /&gt;&lt;br /&gt;8.) Windows Communication Foundation: WCF now works with POX and JSON data.&lt;br /&gt;&lt;br /&gt;9.) Windows Presentation Foundation: Newer plugin model for creating AddIns. Although SilverLight is separate, I think its still presentation right?? SilverLight CLR is also part of the .Net Framework. I really don't know if XAML gets any language change in the 3.5 framework. I love the XAML designer from VS2008 though!!&lt;br /&gt;&lt;br /&gt;10.) Misc: The C/C++ get a standard template libarary (STL) so that these languages can use share .NET libraries&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-7885917317546072643?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/7885917317546072643/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=7885917317546072643' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/7885917317546072643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/7885917317546072643'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/01/new-in-net-framework-35.html' title='New in .NET Framework 3.5'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-634090671421862773</id><published>2009-01-15T07:44:00.000-08:00</published><updated>2009-03-15T08:05:02.210-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><title type='text'>LINQ in query in C#  3.5</title><content type='html'>Hi&lt;br /&gt;LINQ (Language Integrated Query) is the composition of many standard query operators that allow us to work with data of any datasource in a very intuitive way. LINQ provide compile time checking of query and the ability to debug through query.&lt;br /&gt;&lt;br /&gt;To show a very basic example of what can be done with the help of LINQ I am using adding,delete,edit the data and view data.&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Data.SqlClient;&lt;br /&gt;using System.Data.Linq;&lt;br /&gt;using System.Configuration;&lt;br /&gt;using LINQ;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;&lt;br /&gt;namespace Website&lt;br /&gt;{&lt;br /&gt;    public partial class _Default : System.Web.UI.Page&lt;br /&gt;    {&lt;br /&gt;        protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            DisplayGridView();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        protected void TextBox2_TextChanged(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        protected void btnAdd_Click(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            linqDataContext db = new linqDataContext();&lt;br /&gt;&lt;br /&gt;            User user = new User();&lt;br /&gt;            user.UserId = Convert.ToInt16(txtUserId.Text);&lt;br /&gt;            user.UserName = txtUserName.Text;&lt;br /&gt;            db.Users.InsertOnSubmit(user);&lt;br /&gt;            db.SubmitChanges();&lt;br /&gt;&lt;br /&gt;            DisplayGridView();&lt;br /&gt;        }&lt;br /&gt;        public void DisplayGridView()&lt;br /&gt;        {&lt;br /&gt;            linqDataContext db = new linqDataContext();&lt;br /&gt;            var p = from u in db.Users&lt;br /&gt;                    select u;&lt;br /&gt;            GridView1.DataSource = p;&lt;br /&gt;            GridView1.DataBind();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        protected void btnUpdate_Click(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            linqDataContext db = new linqDataContext();&lt;br /&gt;            User objUser = db.Users.Single(p =&gt; p.UserId == Convert.ToInt16(txtUserId.Text));&lt;br /&gt;            objUser.UserName = txtUserName.Text;&lt;br /&gt;            db.SubmitChanges();&lt;br /&gt;            DisplayGridView();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        protected void btnDelete_Click(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            linqDataContext db = new linqDataContext();&lt;br /&gt;            var p = (from u in db.Users&lt;br /&gt;                    where u.UserId == Convert.ToInt16(txtUserId.Text)&lt;br /&gt;                    select u).Single();&lt;br /&gt;            db.Users.DeleteOnSubmit(p);&lt;br /&gt;            db.SubmitChanges();&lt;br /&gt;            DisplayGridView();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-634090671421862773?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/634090671421862773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=634090671421862773' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/634090671421862773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/634090671421862773'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/01/linq-in-query-in-c-35.html' title='LINQ in query in C#  3.5'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-1842337286615552203</id><published>2009-01-08T12:06:00.000-08:00</published><updated>2009-04-08T12:23:03.814-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Differences between user controls and custom controls</title><content type='html'>&lt;p&gt;&lt;strong&gt;User control&lt;br /&gt;Deployment&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Designed for single-application scenariosDeployed in the source form (.ascx) along with the source code of the applicationIf the same control needs to be used in more than one application, it introduces redundancy and maintenance problems&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Creation&lt;br /&gt;&lt;/strong&gt;Creation is similar to the way Web Forms pages are created; well-suited for rapid application development (RAD)&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Content&lt;br /&gt;&lt;/strong&gt;A much better choice when you need static content within a fixed layout, for example, when you make headers and footers&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Design&lt;br /&gt;&lt;/strong&gt;Writing doesn't require much application designing because they are authored at design time and mostly contain static data&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Custom control&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Deployment&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Designed so that it can be used by more than one applicationDeployed either in the application's Bin directory or in the global assembly cacheDistributed easily and without problems associated with redundancy and maintenance&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Creation&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Writing involves lots of code because there is no designer support&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Content&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;More suited for when an application requires dynamic content to be displayed; can be reused across an application, for example, for a data bound table control with dynamic rows&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Design&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Writing from scratch requires a good understanding of the control's life cycle and the order in which events execute, which is normally taken care of in user controls&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-1842337286615552203?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/1842337286615552203/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=1842337286615552203' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/1842337286615552203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/1842337286615552203'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/01/differences-between-user-controls-and.html' title='Differences between user controls and custom controls'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-4400567437180921391</id><published>2009-01-05T10:19:00.000-08:00</published><updated>2009-03-25T10:26:37.437-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Serialization in .NET</title><content type='html'>Introduction&lt;br /&gt;Serialization is a process of taking an object and converting into a form so that it can be transported across the network or can be persisted in the storage location. This storage location can be physical file, database or ASP.NET Cache. The form contains the state of the object so that by this format, we can construct the same object a later point in time, which is called Deserialization.&lt;br /&gt;&lt;br /&gt;There are three formats of serialization&lt;br /&gt;&lt;br /&gt;Binary Serialization : Light and compact used in Remoting&lt;br /&gt;SOAP Serialization : interoperable use SOAP and used in web Services&lt;br /&gt;XML Serialization : Custom Serialization&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;XML SerializationFor XML serialization, you need to use the attributes and specify them for each and every public member that you need. But since it is limited that it can serialize only public members, Serization done by it is called custom serialization. It is also known as Shallow Serialization&lt;br /&gt;&lt;br /&gt;SOAP and Binary SerializationXML serializes only public members of the class. You use SOAP or Binary serialization when you need to transport data across the network. SOAP sends it using HTTP Protocol which makes it most interoperable while Binary serialization is known for its light and compact nature. Web Services uses the SOAP Serialization and Remoting uses the Binary Serialization. Infact Serialization is always neccessary when you need the object to transfer across a network. Advantage of using the SOAP or Binary serialization is that you can serialize the entire object and all those object that are being refrenced by it. This is why it is also called Deep Serialization. If you want any class to serialize through any of these methods then you should use [Serializable] attribute on that class and then you can use the SoapFormater class or BinaryFormatter class to do the serialization. These classes have Serialize and DeSerialize method. If you will not use SerializableAttribute for the class, then it will raise the exception.&lt;br /&gt;&lt;br /&gt;Though this is the easiest way but at time you need the way so that you can decide what fields to serialize and how the serialization actually occurs. You can implement the ISerializable interface in the class. You need two things for that&lt;br /&gt;&lt;br /&gt;Constructor that is overridden and can handle the Deserialization process&lt;br /&gt;GetObject method that tracks about which data is serialized.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-4400567437180921391?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/4400567437180921391/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=4400567437180921391' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4400567437180921391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4400567437180921391'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/01/serialization-in-net.html' title='Serialization in .NET'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-5181256702093305029</id><published>2009-01-04T08:50:00.000-08:00</published><updated>2009-03-11T12:17:43.343-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Improving ASP.NET Performance</title><content type='html'>I came accross a very good article around to improve the performance of the system.&lt;br /&gt;http://msdn2.microsoft.com/en-us/library/ms998549.aspx&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-5181256702093305029?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/5181256702093305029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=5181256702093305029' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/5181256702093305029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/5181256702093305029'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/01/improving-aspnet-performance.html' title='Improving ASP.NET Performance'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-5637561066278979184</id><published>2009-01-01T05:08:00.000-08:00</published><updated>2009-03-11T05:10:55.753-07:00</updated><title type='text'>Happy New Year 2009</title><content type='html'>Happy New Year 2009&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-5637561066278979184?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/5637561066278979184/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=5637561066278979184' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/5637561066278979184'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/5637561066278979184'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/01/happy-new-year-2009.html' title='Happy New Year 2009'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-7744466628782919667</id><published>2008-12-29T04:23:00.000-08:00</published><updated>2009-03-29T04:35:15.623-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><title type='text'>What's New in the .NET Framework  3.5</title><content type='html'>&lt;strong&gt;What's New in the .NET Framework  3.5&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Many new classes and features are provided by the .NET Framework 3.5. This latest version layers on top of the prior version. The .NET Framework 2.0 (and SP1) added many new base classes, interfaces, generics, and more. The interim release (.NET Framework 3.0) that shipped with Windows Vista layered in support for Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF), and Windows Workflow Foundation (WF). This latest version continues to build on that release. The 3.5 version the .NET Framework includes LINQ, a revision to ASP.NET, the Add-In Framework, SQL Synch Services, and more.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ASP.NET—&lt;/strong&gt;&lt;br /&gt;The .NET Framework 3.5 includes many new enhancements for the ASP.NET web developers. The System.Web namespace that backs ASP.NET includes many new classes and controls. For example, the framework now directly supports AJAX programming with the ScriptManager and UpdatePanel controls. There is also a new control for displaying data called ListView, a data-source object called LinqDataSource for working with LINQ data, and a DataPager object for controlling how records are paged in your application.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;LINQ—&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;We’ve mentioned LINQ a few times already; it’s worth noting, however, that LINQ is built into the .NET Framework. This includes the System.Linq namespace that defines standard LINQ query operators and types. The System.Data.Linq namespace holds the connection between databases and the LINQ subsystem. There are more LINQ-related namespaces too. These include System.Data.Linq.Mapping for handling the O/R mapping between SQL and LINQ and System.Xml.Linq for working between XML and the LINQ subsystem. Of course, many of the controls in the framework have also been updated to work with LINQ.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Add-In Framework—&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The System.AddIn namespace is new to the .NET Framework 3.5. It provides classes and methods for developers looking to build applications that can be extended based on a common add-in framework. For example, the AddInStore class allows for the discovery and management of add-ins. The framework also provides versioning, isolation, activation, and sandboxing. If you are building a new application and hope to allow for add-ins, you want to dig in deeper on this namespace.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ClickOnce Improvements—&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;ClickOnce application deployment continues to improve in this latest version of .NET. This includes the capability to deploy an application from multiple locations and third-party branding on your ClickOnce deployment dialogs.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Windows Communication Foundation (WCF)—&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The new System.ServiceModel encapsulates what is known as WCF. With it you can easily create service-based applications that work across multiple protocols, transports, and message types. WCF is a major component of .NET 3.5, “Embedding Workflow in Your Applications.” However, some highlights included in WCF are the following: expose and consume RSS and ATOM feeds with the System.ServiceModel.Syndication namespace; communicate with AJAX operations using the JavaScript Object Notation (JSON) data format built into WCF’s System.Runtime.Serialization.Json namespace; and use the WCF web programming model to create REST (representational state transfer) services to communicate directly across HTTP (without SOAP). In addition, WCF contains the new identity management system called CardSpace.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Windows Presentation Foundation (WPF)—&lt;/strong&gt;&lt;br /&gt;WPF provides a new presentation technology for Windows applications. This technology is spread throughout the System.Windows namespace and includes support for creating Windows applications based on XAML, XBAP, vector graphics, and both 2D and 3D scenarios.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Windows Workflow Foundation (WF)—&lt;/strong&gt;&lt;br /&gt;The System.Workflow namespace first introduced in .NET 3.0 has been extended (and integrated into Visual Studio) in the 3.5 release. WF allows you to create both sequential and state-driven workflows for your applications, host them, persist them, and more. WF is also now integrated with WCF. Therefore, you can easily expose and call a workflow as a WCF service.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Tracing and Diagnostics—&lt;/strong&gt;The System.Diagnostics namespace contains the new EventSchemaTraceListener class to allow for cross-domain, cross-thread, crosscomputer, end-to-end, lock-free logging and tracing.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Pipe Streams—&lt;/strong&gt;The new System.IO.Pipes namespace provides support for both named and anonymous pipe communication. With it, you can write code that communicates at the pipe level across processes and across computers. For example, the NamedPipeServerStream class can be used to allow read and write communication across a named pipe. The NamedPipeClientStream provides client support for communicating with pipe servers.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Threading Improvements—&lt;/strong&gt;There is a new class called ReaderWriterLockSlim in the System.Threading namespace that provides better performance and reduced deadlock scenarios.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Time Zone Additions—&lt;/strong&gt;There are two new types that help you work with applications that need to understand multiple time zones. These classes are System.DateTimeOffset and TimeZoneInfo. The DateTimeOffset structure represents an exact point in time. The offset indicates how the time differs from UTC (Universal Coordinated Time). You use this new class when you need precision and date/time arithmetic. The TimeZoneInfo class is a welcome enhancement that represents a date and time in a given time zone. You can use this class to reliably represent the same date and time in any other time zone. In addition, you can use the class to create custom time zones if needed.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Peer-to-Peer Networking Support—&lt;/strong&gt;The .NET Framework finally has its own peer-to-peer networking support. This can be found in the System.Net.PeerToPeer namespace. With it, you can create an application that works without a server and instead communicates from one client (peer) to another (similar to Microsoft’s Groove application). Application scenarios supported by this new namespace include tracking where peers are (online or offline), what they might be doing, interacting (messaging) with peers, managing peer contacts, discovering new peers, and more.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Sync Services for ADO.NET—&lt;/strong&gt;Shipping with Visual Studio 2008 is Microsoft’s Sync Services. With it you can build an application that works both online and offline. These types of applications are referred to as occasionally connected applications (OCA). You use Sync Services (and its related tools) to indicate which data should be available when a user is offline. When connected, the Sync Services works to synchronize user changes with database changes.&lt;br /&gt;&lt;br /&gt;The Sync Services for ADO.NET is part of the Microsoft.Synchronization.Data namespace. Notice that this is not part of System and therefore not a principal part of the .NET Framework but an add-on library from Microsoft. The ADO.NET services are actually a part of what is called the Microsoft Sync Framework. This framework provides synchronization services for data (ADO.NET), file and folders (the File&lt;br /&gt;System), and RSS/ATOM feeds (FeedSync).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Windows Vista Support—&lt;/strong&gt;The Windows Forms engine has been updated to give your applications Vista support. This means that upgrading your applications will give them that Vista appearance. In addition, you now have access to the common dialogs (System.Windows.Forms.FileDialog) in Vista. For example, the OpenFileDialog and SaveFileDialog support the same interface you see in Windows Vista for opening and saving files.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;.NET Compact Framework—&lt;/strong&gt;A new version of the .NET Compact Framework also ships with 3.5. This framework is used on distributed, mobile devices such as SmartPhones and Windows Mobile/CE devices. This faster version of the framework provides support for WCF, LINQ, and improved debugging and diagnostics.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-7744466628782919667?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/7744466628782919667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=7744466628782919667' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/7744466628782919667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/7744466628782919667'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/12/whats-new-in-net-framework-35.html' title='What&apos;s New in the .NET Framework  3.5'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-3049622472856295216</id><published>2008-12-25T12:56:00.000-08:00</published><updated>2009-03-15T12:58:58.646-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Use of Checked and UnChecked operator.</title><content type='html'>&lt;strong&gt;use of Checked and UnChecked operator.&lt;/strong&gt;&lt;br /&gt;The checked and unchecked operators are used to control the overflow checking context for integral-type arithmetic operations and conversions. &lt;br /&gt;checked-expression: &lt;br /&gt;checked   (   expression   ) &lt;br /&gt;unchecked-expression: &lt;br /&gt;unchecked   (   expression   ) &lt;br /&gt;Stack Overflows are usual problems during arithmetic operations and conversion of integer types. C# supports two operators: checked and unchecked, Which can be used for checking and/or unchecking stack overflows during program execution. &lt;br /&gt;&lt;br /&gt;If an operation is checked, then an exception will be thrown if overflow occurs. If it is not checked, no exception will be raised but we will lose data.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;int a=200000;&lt;br /&gt;int b=300000;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;int m=checked(a*b);&lt;br /&gt;}&lt;br /&gt;catch(OverflowException e)&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(e);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Since a*b produces a value that will exceed the max value for an int, an overflow occurs. As the operation is checked with operator 'checked' , an overflow exception will be thrown. In this case, we will get output like this:&lt;br /&gt;&lt;br /&gt;System.OverflowException: An exception of type System.OverflowException was thrown at ...&lt;br /&gt;&lt;br /&gt;If we want to suppress the overflow checking, we can mark the code as unchecked.&lt;br /&gt;int m = unchecked(a*b);&lt;br /&gt;&lt;br /&gt;In this case, no exception will be raised, but we will lose data.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-3049622472856295216?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/3049622472856295216/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=3049622472856295216' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3049622472856295216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3049622472856295216'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/12/use-of-checked-and-unchecked-operator.html' title='Use of Checked and UnChecked operator.'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-5879976631159630368</id><published>2008-12-21T11:25:00.000-08:00</published><updated>2009-03-16T11:26:32.423-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>When use Interface and Abstract Class? In which Scenario.</title><content type='html'>1. If you do not have any default implementation then go for Interfaces. If you have any default or standard code for the methods then go for Abstract class as it can accept partial implementation. &lt;br /&gt;2. In future if you plan to inherit from multiple inheritance then go for interface. Abstract class do not allow multiple implementation.&lt;br /&gt;3. If you want to restrict the accessbility of the methods that is defined then go for Abstract class as it can contain access modifiers for the subs, functions, properties.&lt;br /&gt;&lt;br /&gt;Hope this would give an idea for your preference.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Interface is used to provide their own implementation, so your method signature is specified in interface which your implementing class need to implement inside and implementation would differ according to your requirement, example your known interface iEnumerable, iDisposable.&lt;br /&gt;&lt;br /&gt;Another advantage is that your class can support multiple implementation using multiple interfaces.&lt;br /&gt;&lt;br /&gt;Abstract class is used when you want to specify some common implementation (common in your application) along with variable things. &lt;br /&gt;As Abstract Class allow implementation alogn with abstract methods. which inheriting class need to implement.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Abstract Classes: Classes which cannot be instantiated. This means one &lt;br /&gt;cannot make a object of this class or in other way cannot create &lt;br /&gt;object by saying ClassAbs abs = new ClassAbs(); where ClassAbs is &lt;br /&gt;abstract class.&lt;br /&gt;&lt;br /&gt;Abstarct classes contains have one or more abstarct methods, ie method &lt;br /&gt;body only no implementation.&lt;br /&gt;&lt;br /&gt;Interfaces: These are same as abstract classes only difference is we &lt;br /&gt;an only define method defination and no implementation.&lt;br /&gt;&lt;br /&gt;When to use wot depends on various reasons. One being design choice.&lt;br /&gt;&lt;br /&gt;One reason for using abstarct classes is we can code common &lt;br /&gt;functionality and force our developer to use it. I can have a complete &lt;br /&gt;class but I can still mark the class as abstract.&lt;br /&gt;Developing by interface helps in object based communication. &lt;br /&gt;&lt;br /&gt;When we do not want any one to create object of our class we define the class as abstract.&lt;br /&gt;when we have some properties to which the functionalities that defer depending on the user specifications we use interfaces where the common properties are declared but the implementation is done by the user according to his will.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Why use interface?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;1. An interface is an entity that is defined by the word Interface and is not a class. An interface cannot have an implementation; it only has the signature - just the definition of the methods without the body. We can implement the methods in the classes in future by inheriting these interfaces.&lt;br /&gt;2. Also, no fields can be defined in interfaces. &lt;br /&gt;3. C# doesn’t support multiple inheritance hence interfaces are used to implement multiple inheritance.&lt;br /&gt;4.An interface cannot have access modifiers for the subs, functions, properties etc. Everything is assumed to be Public.&lt;br /&gt;5.Interfaces are used to define the peripheral abilities of a class. In other words both Human and Vehicle can inherit from a IMovable interface.&lt;br /&gt;&lt;br /&gt;These features make us to use interfaces.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When we want to force the user to use the methods. so we will go for the interface. it will not have any defination of the method. the inherited method will add its own defination. we can use the interface as multiple inheritence.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-5879976631159630368?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/5879976631159630368/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=5879976631159630368' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/5879976631159630368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/5879976631159630368'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/12/when-use-interface-and-abstract-class.html' title='When use Interface and Abstract Class? In which Scenario.'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-5975712216082898302</id><published>2008-12-16T11:41:00.000-08:00</published><updated>2009-03-15T11:43:39.484-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Polymorphism</title><content type='html'>&lt;p&gt;&lt;strong&gt;Dynamic Polymorphism&lt;/strong&gt;&lt;br /&gt;There are two type of polymorphism i.e.&lt;br /&gt; static(compiplation time) and&lt;br /&gt; Dynamic Polymorphism(Run Time).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Example of Compile Time Polymorphism&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Method Overloading&lt;br /&gt;- Method with same name but with different arguments is called method overloading.&lt;br /&gt;- Method Overloading forms compile-time polymorphism.&lt;br /&gt;- Example of Method Overloading:&lt;br /&gt;class A1&lt;br /&gt;{&lt;br /&gt;void hello()&lt;br /&gt;{ Console.WriteLine(“Hello”); }&lt;br /&gt;&lt;br /&gt;void hello(string s)&lt;br /&gt;{ Console.WriteLine(“Hello {0}”,s); }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Example of Run Time Polymorphism&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Method Overriding&lt;br /&gt;- Method overriding occurs when child class declares a method that has the same type arguments as a method declared by one of its superclass.&lt;br /&gt;- Method overriding forms Run-time polymorphism.&lt;br /&gt;- Note: By default functions are not virtual in C# and so you need to write “virtual” explicitly. While by default in Java each function are virtual.&lt;br /&gt;- Example of Method Overriding:&lt;br /&gt;Class parent&lt;br /&gt;{&lt;br /&gt;virtual void hello()&lt;br /&gt;{ Console.WriteLine(“Hello from Parent”); }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Class child : parent&lt;br /&gt;{&lt;br /&gt;override void hello()&lt;br /&gt;{ Console.WriteLine(“Hello from Child”); }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;static void main()&lt;br /&gt;{&lt;br /&gt;parent objParent = new child();&lt;br /&gt;objParent.hello();&lt;br /&gt;}&lt;br /&gt;//Output&lt;br /&gt;Hello from Child.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-5975712216082898302?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/5975712216082898302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=5975712216082898302' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/5975712216082898302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/5975712216082898302'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/12/polymorphism.html' title='Polymorphism'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-7233475625402417418</id><published>2008-12-16T11:18:00.000-08:00</published><updated>2009-03-16T11:22:24.087-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Tool are use to evaluate the performance in sql server application</title><content type='html'>In SQL Server below are some of tools we use to evluate the performance in sql server application.&lt;br /&gt;&lt;br /&gt;1.Query Analyzer.&lt;br /&gt;2.Index Wizard.&lt;br /&gt;3.Profiler.&lt;br /&gt;4.Performance Monitor&lt;br /&gt;&lt;br /&gt;Check the below link for more info.&lt;br /&gt;http://www.sqlteam.com/article/sql-server-2000-performance-tuning-tools&lt;br /&gt;http://www.gre-sqlserver-solutions.com/MonitoringTools.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-7233475625402417418?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/7233475625402417418/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=7233475625402417418' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/7233475625402417418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/7233475625402417418'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/12/tool-are-use-to-evaluate-performance-in.html' title='Tool are use to evaluate the performance in sql server application'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-4889235805778854453</id><published>2008-12-15T10:30:00.000-08:00</published><updated>2009-03-15T10:34:44.771-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET 3.5'/><title type='text'>Partial Classes</title><content type='html'>Hi,&lt;br /&gt;Partial Classes are useful feature for separating machine generated code and hard written code in the same class.It is possible to split the definition of a class or a struct, or an interface over two or more source files. Each source file contains a section of the class definition, and all parts are combined when the application is compiled. There are several situations when splitting a class definition is desirable:&lt;br /&gt;1. When working on large projects, spreading a class over separate files allows multiple programmers to work on it simultaneously.&lt;br /&gt;2. When working with automatically generated source, code can be added to the class without having to recreate the source file. Visual Studio uses this approach when creating Windows Forms, Web Service wrapper code, and so on. You can create code that uses these classes without having to edit the file created by Visual Studio.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-4889235805778854453?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/4889235805778854453/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=4889235805778854453' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4889235805778854453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4889235805778854453'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/12/partial-classes.html' title='Partial Classes'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-8432509325954433721</id><published>2008-12-12T12:27:00.000-08:00</published><updated>2009-03-15T12:33:13.572-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Generic class can be inherited by a normal class</title><content type='html'>&lt;strong&gt;Generic class can be inherited by a normal class.&lt;/strong&gt;&lt;br /&gt;Yes, a normal class can be derived from a Generic class.&lt;br /&gt;public class T&lt; a &gt;{&lt;br /&gt;protected A t;&lt;br /&gt;public T(A a) {&lt;br /&gt; t = a;&lt;br /&gt;}}&lt;br /&gt;Here Class T is a generic class and the following class B inherited from T of type integer&lt;br /&gt;public class B:T &lt;int&gt;&lt;br /&gt;{&lt;br /&gt;public B(int a) : base(a) { }&lt;br /&gt;public void Print() { Console.WriteLine(t); }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;We should mention the Type in angle bracket (&lt;&gt;) to know which type of non generic class this is.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-8432509325954433721?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/8432509325954433721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=8432509325954433721' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/8432509325954433721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/8432509325954433721'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/05/generic-class-can-be-inherited-by.html' title='Generic class can be inherited by a normal class'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-8957876241196373523</id><published>2008-12-12T11:33:00.000-08:00</published><updated>2009-03-11T11:51:56.479-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Temp Table VS Table Variable</title><content type='html'>Most of the SQL Developers/DBA would have come across a situation where they need to store the temporary result sets. This is where Temp tables and Table variables come into effect and helps in storing the data sets in a temporary location.&lt;br /&gt;Temp table:&lt;br /&gt;Consider the below sample temp table which holds the information about companies.&lt;br /&gt;CREATE TABLE #Tmp&lt;br /&gt;(&lt;br /&gt;CompanyId Int,&lt;br /&gt;Name varchar (50),&lt;br /&gt;Location varchar (50)&lt;br /&gt;)&lt;br /&gt;1. The temp table name always starts with # or ## and are created in the tempdb database. The # indicates that the temp table is a local temporary table i.e. table is accessible only by the particular connection of SQL Server which created it. The ## indicates that the temp table is a global temporary table i.e. the table is accessible from any connection. They are dropped automatically when the last session that uses them has completed.&lt;br /&gt;2. Since the local temporary table is accessible only by the connection which created it, this helps in minimizing the locks.&lt;br /&gt;3. We can create indexes, statistics in temp tables and hence performance can be improved.&lt;br /&gt;4. We cannot have foreign key constraints on temp tables.&lt;br /&gt;5. Causes recompilation within stored procedures.&lt;br /&gt;6. Only undo information is logged in tempdb and not the redo information.&lt;br /&gt;7. We can Rollback the transactions in temp table similar to a normal table but not in table variable.&lt;br /&gt;8.Temp tables can be used in nested stored procedures.&lt;br /&gt;9. The temp table names cannot exceed 116 characters whereas the permanent table can have 128 characters&lt;br /&gt;&lt;br /&gt;The following example illustrates the transaction behavior in Temp tables:&lt;br /&gt;--using temp tables where ROLLBACK happens&lt;br /&gt;CREATE TABLE #Tmp&lt;br /&gt;(&lt;br /&gt;CompanyId Int,&lt;br /&gt;Name varchar(20),&lt;br /&gt;Location varchar(20)&lt;br /&gt;)&lt;br /&gt;GO&lt;br /&gt;INSERT INTO #Tmp&lt;br /&gt;VALUES (1,'Saikat','Kolkata')&lt;br /&gt;GO&lt;br /&gt;BEGIN TRAN&lt;br /&gt;UPDATE #Tmp&lt;br /&gt;SET Location='KOL'&lt;br /&gt;WHERE CompanyId=1&lt;br /&gt;ROLLBACK TRAN&lt;br /&gt;SELECT * FROM #Tmp&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Table variables:&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;The following the syntax for table variables:&lt;br /&gt;DECLARE @Tmp TABLE&lt;br /&gt;(&lt;br /&gt;CompanyId Int,&lt;br /&gt;Name varchar(20),&lt;br /&gt;Location varchar(20)&lt;br /&gt;)&lt;br /&gt;1. Table variables are local to a stored procedure and hence cannot be used in nested stored procedures&lt;br /&gt;2.We cannot create Nonclustered indexes in Table variables only Clustered index can be created by specifying them as constraints (Primary or Unique) DECLARE @Tmp TABLE (C1 int, C2 int, PRIMARY KEY (C1, C2))&lt;br /&gt;3.Table variables store the contents in memory but not always. Under extreme memory pressure, the pages belonging to table variables will be moved to tempdb&lt;br /&gt;4.We cannot Alter a table variable once its declared&lt;br /&gt;5.We cannot create statistics in table variables&lt;br /&gt;6.They cannot make use of multiple processors and hence Parallelism is not possible&lt;br /&gt;7.Transactions cannot be rollbacked in Table variable&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-8957876241196373523?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/8957876241196373523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=8957876241196373523' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/8957876241196373523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/8957876241196373523'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/12/temp-table-vs-table-variable.html' title='Temp Table VS Table Variable'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-7595620787856863044</id><published>2008-12-07T12:01:00.000-08:00</published><updated>2009-03-15T12:06:18.844-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Private constructor and where will you use it.</title><content type='html'>&lt;strong&gt;Private constructor and where will you use it.&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt; When you declare a Constructor with Private access modifier then it is called Private Constructor. If you declare a Constructor as private then it don't allow to create object for its derived class,i.e you loose inhirect facility for that class.&lt;br /&gt;Ex:&lt;br /&gt;Class A{&lt;br /&gt;// some code&lt;br /&gt;Private Void A()&lt;br /&gt;{&lt;br /&gt;//Private Constructor&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;Class B:A&lt;br /&gt;{&lt;br /&gt;//code&lt;br /&gt;}&lt;br /&gt; B obj = new B();// will give Compilation Error&lt;br /&gt;&lt;br /&gt;Because Class A construcor declared as private hence its accessbility limit is to that class only ,Class B can't access. As i explained the heirarchy of Constructors in the previous qn, when we create a object for Class B that constructor will call constructor A but class B have no rights to access the Class A constructor hence we will get compilation error.&lt;br /&gt;&lt;br /&gt;When we want to control the object instantiation or trying to implement singleton pattern&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-7595620787856863044?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/7595620787856863044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=7595620787856863044' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/7595620787856863044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/7595620787856863044'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/12/private-constructor-and-where-will-you.html' title='Private constructor and where will you use it.'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-7342064545585032304</id><published>2008-11-29T05:15:00.000-08:00</published><updated>2009-03-29T05:19:13.321-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Static Member, Static Method, Static Constructor</title><content type='html'>Static Members of the class&lt;br /&gt;“static members” belong to the whole class rather than to individual object&lt;br /&gt;&lt;br /&gt;How to access static member of class?&lt;br /&gt;Static members are accessed with the name of class rather than reference to objects. Example: className.StaticMemberName&lt;br /&gt;&lt;br /&gt;Example of Static Member&lt;br /&gt;&lt;br /&gt;class Test&lt;br /&gt;{&lt;br /&gt;public int rollNo;&lt;br /&gt;public int mathsMarks;&lt;br /&gt;public static int totalMathMarks;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class TestDemo&lt;br /&gt;{&lt;br /&gt;public static void main()&lt;br /&gt;{&lt;br /&gt;Test stud1 = new Test();&lt;br /&gt;stud1.rollNo = 1;&lt;br /&gt;stud1.mathsMarks = 40;&lt;br /&gt;&lt;br /&gt;stud2.rollNo = 2;&lt;br /&gt;stud2.mathsMarks = 43;&lt;br /&gt;&lt;br /&gt;Test.totalMathsMarks = stud1.mathsMarks + stud2.mathsMarks;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Static Method of the class&lt;br /&gt;- Static Method is Method that you can call directly without first creating an instance of a class. Example: Main() Method, Console.WriteLine()&lt;br /&gt;- You can use static fields, methods, properties and even constructors which will be called before any instance of the class is created.&lt;br /&gt;- As static methods may be called without any reference to object, you can not use instance members inside static methods or properties, while you may call a static member from a non-static context. The reason for being able to call static members from non-static context is that static members belong to the class and are present irrespective of the existence of even a single object.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Static Constructor&lt;br /&gt;In C# it is possible to write a static no-parameter constructor for a class. Such a class is executed once, when first object of class is created.&lt;br /&gt;&lt;br /&gt;One reason for writing a static constructor would be if your class has some static fields or properties that need to be initialized from an external source before the class is first used.&lt;br /&gt;Example&lt;br /&gt;Class MyClass&lt;br /&gt;{&lt;br /&gt;static MyClass()&lt;br /&gt;{&lt;br /&gt;//Initialization Code for static fields and properties.&lt;br /&gt;}&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-7342064545585032304?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/7342064545585032304/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=7342064545585032304' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/7342064545585032304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/7342064545585032304'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/11/static-member-static-method-static.html' title='Static Member, Static Method, Static Constructor'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-8636843047968930981</id><published>2008-11-29T05:08:00.000-08:00</published><updated>2009-03-29T05:15:31.376-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>What is Difference between == and .Equals() Method?</title><content type='html'>What is Difference between == and .Equals() Method?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For Value Type: == and .Equals() method usually compare two objects by value.&lt;br /&gt;&lt;br /&gt;For Example: &lt;br /&gt;&lt;br /&gt;int x = 10;&lt;br /&gt;&lt;br /&gt;int y = 10;&lt;br /&gt;&lt;br /&gt;Console.WriteLine( x == y);&lt;br /&gt;&lt;br /&gt;Console.WriteLine(x.Equals(y));&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Will display:&lt;br /&gt;&lt;br /&gt;True&lt;br /&gt;&lt;br /&gt;True&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For Reference Type: == performs an identity comparison, i.e. it will only return true if both references point to the same object. While Equals() method is expected to perform a value comparison, i.e. it will return true if the references point to objects that are equivalent.&lt;br /&gt;&lt;br /&gt;For Example:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;StringBuilder s1 = new StringBuilder(“Yes”);&lt;br /&gt;&lt;br /&gt;StringBuilder s2 = new StringBuilder(“Yes”); &lt;br /&gt;&lt;br /&gt;Console.WriteLine(s1 == s2);&lt;br /&gt;&lt;br /&gt;Console.WriteLine(s1.Equals(s2));&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Will display:&lt;br /&gt;&lt;br /&gt;False&lt;br /&gt;&lt;br /&gt;True&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In above example, s1 and s2 are different objects hence “==” returns false, but they are equivalent hence “Equals()” method returns true. Remember there is an exception of this rule, i.e. when you use “==” operator with string class it compares value rather than identity.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When to use “==” operator and when to use “.Equals()” method? &lt;br /&gt;&lt;br /&gt;For value comparison, with Value Tyep use “==” operator and use “Equals()” method while performing value comparison with Reference Type.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-8636843047968930981?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/8636843047968930981/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=8636843047968930981' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/8636843047968930981'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/8636843047968930981'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/11/what-is-difference-between-and-equals.html' title='What is Difference between == and .Equals() Method?'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-3849995328878521568</id><published>2008-11-29T05:03:00.000-08:00</published><updated>2009-03-29T05:05:22.912-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>SQL Optimization Tips</title><content type='html'>&lt;strong&gt;SQL Optimization Tips &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;• Use views and stored procedures instead of heavy-duty queries.&lt;br /&gt;This can reduce network traffic, because your client will send to&lt;br /&gt;server only stored procedure or view name (perhaps with some&lt;br /&gt;parameters) instead of large heavy-duty queries text. This can be used&lt;br /&gt;to facilitate permission management also, because you can restrict&lt;br /&gt;user access to table columns they should not see.&lt;br /&gt;&lt;br /&gt;• Try to use constraints instead of triggers, whenever possible.&lt;br /&gt;Constraints are much more efficient than triggers and can boost&lt;br /&gt;performance. So, you should use constraints instead of triggers,&lt;br /&gt;whenever possible.&lt;br /&gt;&lt;br /&gt;• Use table variables instead of temporary tables.&lt;br /&gt;Table variables require less locking and logging resources than&lt;br /&gt;temporary tables, so table variables should be used whenever possible.&lt;br /&gt;The table variables are available in SQL Server 2000 only.&lt;br /&gt;&lt;br /&gt;• Try to use UNION ALL statement instead of UNION, whenever possible.&lt;br /&gt;The UNION ALL statement is much faster than UNION, because UNION ALL&lt;br /&gt;statement does not look for duplicate rows, and UNION statement does&lt;br /&gt;look for duplicate rows, whether or not they exist.&lt;br /&gt;&lt;br /&gt;• Try to avoid using the DISTINCT clause, whenever possible.&lt;br /&gt;Because using the DISTINCT clause will result in some performance&lt;br /&gt;degradation, you should use this clause only when it is necessary.&lt;br /&gt;&lt;br /&gt;• Try to avoid using SQL Server cursors, whenever possible.&lt;br /&gt;SQL Server cursors can result in some performance degradation in&lt;br /&gt;comparison with select statements. Try to use correlated sub-query or&lt;br /&gt;derived tables, if you need to perform row-by-row operations.&lt;br /&gt;&lt;br /&gt;• Try to avoid the HAVING clause, whenever possible.&lt;br /&gt;The HAVING clause is used to restrict the result set returned by the&lt;br /&gt;GROUP BY clause. When you use GROUP BY with the HAVING clause, the&lt;br /&gt;GROUP BY clause divides the rows into sets of grouped rows and&lt;br /&gt;aggregates their values, and then the HAVING clause eliminates&lt;br /&gt;undesired aggregated groups. In many cases, you can write your select&lt;br /&gt;statement so, that it will contain only WHERE and GROUP BY clauses&lt;br /&gt;without HAVING clause. This can improve the performance of your query.&lt;br /&gt;&lt;br /&gt;• If you need to return the total table's row count, you can use&lt;br /&gt;alternative way instead of SELECT COUNT(*) statement.&lt;br /&gt;Because SELECT COUNT(*) statement make a full table scan to return the&lt;br /&gt;total table's row count, it can take very many time for the large&lt;br /&gt;table. There is another way to determine the total row count in a&lt;br /&gt;table. You can use sysindexes system table, in this case. There is&lt;br /&gt;ROWS column in the sysindexes table. This column contains the total&lt;br /&gt;row count for each table in your database. So, you can use the&lt;br /&gt;following select statement instead of SELECT COUNT(*): SELECT rows&lt;br /&gt;FROM sysindexes WHERE id = OBJECT_ID('table_name') AND indid &lt; 2 So,&lt;br /&gt;you can improve the speed of such queries in several times.&lt;br /&gt;&lt;br /&gt;• Include SET NOCOUNT ON statement into your stored procedures to stop&lt;br /&gt;the message indicating the number of rows affected by a T-SQL statement.&lt;br /&gt;This can reduce network traffic, because your client will not receive&lt;br /&gt;the message indicating the number of rows affected by a T-SQL statement.&lt;br /&gt;&lt;br /&gt;• Try to restrict the queries result set by using the WHERE clause.&lt;br /&gt;This can results in good performance benefits, because SQL Server will&lt;br /&gt;return to client only particular rows, not all rows from the table(s).&lt;br /&gt;This can reduce network traffic and boost the overall performance of&lt;br /&gt;the query.&lt;br /&gt;&lt;br /&gt;• Use the select statements with TOP keyword or the SET ROWCOUNT&lt;br /&gt;statement, if you need to return only the first n rows.&lt;br /&gt;This can improve performance of your queries, because the smaller&lt;br /&gt;result set will be returned. This can also reduce the traffic between&lt;br /&gt;the server and the clients.&lt;br /&gt;&lt;br /&gt;• Try to restrict the queries result set by returning only the&lt;br /&gt;particular columns from the table, not all table's columns.&lt;br /&gt;This can results in good performance benefits, because SQL Server will&lt;br /&gt;return to client only particular columns, not all table's columns.&lt;br /&gt;This can reduce network traffic and boost the overall performance of&lt;br /&gt;the query.&lt;br /&gt;1.Indexes&lt;br /&gt;2.avoid more number of triggers on the table&lt;br /&gt;3.unnecessary complicated joins&lt;br /&gt;4.correct use of Group by clause with the select list&lt;br /&gt;5 In worst cases Denormalization&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Index Optimization tips&lt;br /&gt;&lt;br /&gt;• Every index increases the time in takes to perform INSERTS, UPDATES&lt;br /&gt;and DELETES, so the number of indexes should not be very much. Try to&lt;br /&gt;use maximum 4-5 indexes on one table, not more. If you have read-only&lt;br /&gt;table, then the number of indexes may be increased.&lt;br /&gt;&lt;br /&gt;• Keep your indexes as narrow as possible. This reduces the size of&lt;br /&gt;the index and reduces the number of reads required to read the index.&lt;br /&gt;&lt;br /&gt;• Try to create indexes on columns that have integer values rather&lt;br /&gt;than character values.&lt;br /&gt;&lt;br /&gt;• If you create a composite (multi-column) index, the order of the&lt;br /&gt;columns in the key are very important. Try to order the columns in the&lt;br /&gt;key as to enhance selectivity, with the most selective columns to the&lt;br /&gt;leftmost of the key.&lt;br /&gt;&lt;br /&gt;• If you want to join several tables, try to create surrogate integer&lt;br /&gt;keys for this purpose and create indexes on their columns.&lt;br /&gt;&lt;br /&gt;• Create surrogate integer primary key (identity for example) if your&lt;br /&gt;table will not have many insert operations.&lt;br /&gt;&lt;br /&gt;• Clustered indexes are more preferable than nonclustered, if you need&lt;br /&gt;to select by a range of values or you need to sort results set with&lt;br /&gt;GROUP BY or ORDER BY.&lt;br /&gt;&lt;br /&gt;• If your application will be performing the same query over and over&lt;br /&gt;on the same table, consider creating a covering index on the table.&lt;br /&gt;&lt;br /&gt;• You can use the SQL Server Profiler Create Trace Wizard with&lt;br /&gt;"Identify Scans of Large Tables" trace to determine which tables in&lt;br /&gt;your database may need indexes. This trace will show which tables are&lt;br /&gt;being scanned by queries instead of using an index.&lt;br /&gt;&lt;br /&gt;• You can use sp_MSforeachtable undocumented stored procedure to&lt;br /&gt;rebuild all indexes in your database. Try to schedule it to execute&lt;br /&gt;during CPU idle time and slow production periods.&lt;br /&gt;sp_MSforeachtable @command1="print '?' DBCC DBREINDEX ('?')"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-3849995328878521568?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/3849995328878521568/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=3849995328878521568' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3849995328878521568'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3849995328878521568'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/11/sql-optimization-tips.html' title='SQL Optimization Tips'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-2234999184648212546</id><published>2008-11-22T11:55:00.000-08:00</published><updated>2009-03-15T12:00:54.740-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>In which Scenario you will go for Interface or Abstract Class</title><content type='html'>&lt;strong&gt;In which Scenario you will go for Interface or Abstract Class&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;when u want to go for inheritance in so many derived classes but the methods implementations are different for different derived classes then u will make the class as abstract or interface. When all the method's implementations are based on derived class u will go for interface and if few implementations are common and remaining depends on derived class u will go for abstract class where u can have defined as well as declared methods also. Note: abstract and interface classes are used when their methods are mandatory for derived classes and are not optional. They put restriction on derived classes that they cannot skip those methods withoud having them in it.&lt;br /&gt;Abstract class can or cannot have methods in it and it cannot be instatiated.It has to be inherited for use .&lt;br /&gt;Abstract class can be used when you want to provide a generalized form of abstraction and leave the implementation task with the inheriting subclass.&lt;br /&gt;&lt;br /&gt;Interface - group of related methods with only signatures of methods .&lt;br /&gt;&lt;br /&gt;Interface are implemented whereas Abstract classes are inherited.&lt;br /&gt;&lt;br /&gt;When you need some classes to use some methods which you don't want to be included in the class ,then you go for the interface, which makes it easy to just implement and make use of the methods defined in the interface.&lt;br /&gt;But you are forced to implement all the methods defined in the interface , even if you dont need some of them.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-2234999184648212546?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/2234999184648212546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=2234999184648212546' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2234999184648212546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2234999184648212546'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/11/in-which-scenario-you-will-go-for.html' title='In which Scenario you will go for Interface or Abstract Class'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-2956585881627315018</id><published>2008-11-16T11:26:00.000-08:00</published><updated>2009-03-16T11:39:10.008-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>FAQ in Static</title><content type='html'>1. What is a static class?&lt;br /&gt;static class is a class declared with the keyword static&lt;br /&gt;eg:&lt;br /&gt;&lt;br /&gt;public static class Employee()&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;you cannot declare an instance member inside a static class&lt;br /&gt;ie static class members also should static&lt;br /&gt;eg:&lt;br /&gt;&lt;br /&gt;public static class Employee()&lt;br /&gt;{&lt;br /&gt;private static string _address;&lt;br /&gt;&lt;br /&gt;public static String GetName()&lt;br /&gt;{&lt;br /&gt;string x = "Saikat";&lt;br /&gt;return x;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;you cannot create an instance of this static class&lt;br /&gt;so if you want to call the members inside a static class you have to call like&lt;br /&gt;&lt;br /&gt;Employee.GetName();&lt;br /&gt;2. What is static member?&lt;br /&gt;A static member is a variable which shares the common memory for every object.Static variable is automatically initialized to zero.We can call static member in three ways &lt;br /&gt;&lt;br /&gt;1&gt;directly by specifying variable name.&lt;br /&gt;2&gt;by using class name.&lt;br /&gt;3&gt;by using object also.&lt;br /&gt;&lt;br /&gt;Example on static member:&lt;br /&gt;&lt;br /&gt;class ABC&lt;br /&gt;{&lt;br /&gt;static int i=2;&lt;br /&gt;public void Increment()&lt;br /&gt;{&lt;br /&gt;i++;&lt;br /&gt;}&lt;br /&gt;public void Display()&lt;br /&gt;{&lt;br /&gt;MessageBox.Show(i.toString());&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private void button1_click()&lt;br /&gt;{&lt;br /&gt;ABC obj;&lt;br /&gt;obj.Increment();&lt;br /&gt;obj.Display();&lt;br /&gt;obj.Display();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;o/p:3&lt;br /&gt;o/p:4&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. What is static function?&lt;/strong&gt;&lt;br /&gt;Static function can only access static members. You cannot modify the definition of the function once you intialize.&lt;br /&gt;--------&lt;br /&gt;A static function is a function which contains only static variables.&lt;br /&gt;We can call static function without creating object also.We can call static function in three ways as follows&lt;br /&gt;&lt;br /&gt;1&gt;directly by writing function name.&lt;br /&gt;2&gt;by using class name.&lt;br /&gt;3&gt;by using object also.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. What is static constructor?&lt;/strong&gt;&lt;br /&gt;A static constructor is used to initialize any static data, or to perform a particular action that needs performed once only.&lt;br /&gt;----------&lt;br /&gt;A static constructor will run ONLY once and that once will be when the class is FIRST used.&lt;br /&gt;&lt;br /&gt;So, in your case, if anybody goes:&lt;br /&gt;&lt;br /&gt;Log log = new Log();&lt;br /&gt;&lt;br /&gt;The static constructor will run first, and then the default (or any other constructor) will run. If more instances are created, the static constructor WILL NOT BE CALLED AGAIN.&lt;br /&gt;&lt;br /&gt;Now, suppose, in your Log class you have a static method called SayHellokannan();&lt;br /&gt;&lt;br /&gt;If anyone calls Log.SayHellokannan() this is what will happen:&lt;br /&gt;&lt;br /&gt;If the class Log has not been used before (either instantiated or had a static method called), i.e. the static constructor has not fired yet, then the static constructor will be called. After that, the SayHellokannan method will be called. If the static constructor has already been run once (either by instantiation or by having a static method called), only the SayHellokannan Method will be called.&lt;br /&gt;&lt;br /&gt;So, in any case, the static constructor runs only when the class is first used. And it runs before any other method or constructor that first time.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5. How can we inherit a static variable?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;We can't inherit a static member or variable.Static member occupies a separate memory and is shared by every object.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;6. How can we inherit a static member?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;We can't inherit a static member. Static member occupies a separate memory and is shared by every object.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;7. Can we use a static function with a non-static variable?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;No&lt;br /&gt;Static Function in bound to class. So you can not access non static (instance) variable from that function. &lt;br /&gt;--------&lt;br /&gt;&lt;br /&gt;public class Employee&lt;br /&gt;{&lt;br /&gt;private string _empName = "saikat":&lt;br /&gt;&lt;br /&gt;public static String GetName()&lt;br /&gt;{&lt;br /&gt;return _empName&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This is not correct. Because i used a nonstatic variable inside a static function. This will make error.&lt;br /&gt;&lt;br /&gt;see another eg:&lt;br /&gt;&lt;br /&gt;public class Employee&lt;br /&gt;{&lt;br /&gt;private static string _empName = "Saikat":&lt;br /&gt;&lt;br /&gt;public static String GetName()&lt;br /&gt;{&lt;br /&gt;return _empName&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This is the correct way&lt;br /&gt;&lt;br /&gt;But u can use a nonstatic variable inside a function like this&lt;br /&gt;&lt;br /&gt;public class Employee&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;public static String GetName()&lt;br /&gt;{&lt;br /&gt;string _empName = "Saikat":&lt;br /&gt;return _empName&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;8. How can we access static variable?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Static variables are assinge to class and not to an instance.&lt;br /&gt;public class A&lt;br /&gt;{&lt;br /&gt;static int var1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class B&lt;br /&gt;{&lt;br /&gt;A InstOfA = new A();&lt;br /&gt;//But when you want to access static variable use class name&lt;br /&gt;A.var1;&lt;br /&gt;//Do not use InstOfA.var1&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;So Static variable is acessed as ClassName.variableName&lt;br /&gt;The static variables are shared by all the objects of a class where they are declared.so their exits only one copy of a static variable.To access them you use classname. this holds good for static functons also.&lt;br /&gt;&lt;br /&gt;classname.static_variablename&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;class one&lt;br /&gt;{&lt;br /&gt;static i;&lt;br /&gt;int a;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;class two&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;one o=new one();&lt;br /&gt;one.i=10; // initializing the static variable&lt;br /&gt;o.a=20; // initializing the data member&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;9. Why main function is static?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;We are writing main function as static because main function is written inside a class ans also the starting point of the program,so we have to call without creating a object of it that's why we make it static .Static function can be call without creating object also.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-2956585881627315018?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/2956585881627315018/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=2956585881627315018' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2956585881627315018'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2956585881627315018'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/11/faq-in-static.html' title='FAQ in Static'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-4174986616249068521</id><published>2008-11-16T11:15:00.000-08:00</published><updated>2009-03-16T11:16:42.410-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>ENUM</title><content type='html'>The enum is used to declare an enumeration.&lt;br /&gt;&lt;br /&gt;Example&lt;br /&gt;enum Numbers{Zero, One, Two, Three};&lt;br /&gt;&lt;br /&gt;Enum is a type consisting of a set of named constants called the enumerator list. By default, the first has the value 0, and the value of each successive is increased by 1. &lt;br /&gt;&lt;br /&gt;Here Zero = 0, One = 1, Two = 2 ...&lt;br /&gt;&lt;br /&gt;But you can force the Starting Value like&lt;br /&gt;&lt;br /&gt;enum Numbers{Zero=10, One, Two, Three};&lt;br /&gt;&lt;br /&gt;Here Zero = 10, One = 11, Two = 12 ...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-4174986616249068521?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/4174986616249068521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=4174986616249068521' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4174986616249068521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4174986616249068521'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/11/enum.html' title='ENUM'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-9217876616288893329</id><published>2008-11-15T11:45:00.000-08:00</published><updated>2009-03-15T11:51:07.941-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Properties</title><content type='html'>Properties&lt;br /&gt;Properties are members that provide a flexible mechanism to read, write, or compute the values of private fields. Properties can be used as though they are public data members, but they are actually special methods called accessors. This enables data to be accessed easily while still providing the safety and flexibility of methods.&lt;br /&gt;In this example, the class TimePeriod stores a time period. Internally the class stores the time in seconds, but a property called Hours is provided that allows a client to specify a time in hours. The accessors for the Hours property perform the conversion between hours and seconds.&lt;br /&gt;&lt;br /&gt;class TimePeriod&lt;br /&gt;{  &lt;br /&gt; private double seconds;    &lt;br /&gt;public double Hours  &lt;br /&gt; {      &lt;br /&gt; get&lt;br /&gt;{&lt;br /&gt; return seconds / 3600;&lt;br /&gt;}       &lt;br /&gt;set&lt;br /&gt;{&lt;br /&gt;seconds = value * 3600;&lt;br /&gt;}   &lt;br /&gt;}}&lt;br /&gt;class Program{   &lt;br /&gt;static void Main()  &lt;br /&gt; {       &lt;br /&gt;TimePeriod t = new TimePeriod();         // Assigning the Hours property causes the 'set' accessor to be called.       &lt;br /&gt;t.Hours = 24;         // Evaluating the Hours property causes the 'get' accessor to be called.       &lt;br /&gt;System.Console.WriteLine("Time in hours: " + t.Hours);   &lt;br /&gt;}}&lt;br /&gt;Time in hours: 24&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Interface Properties &lt;/strong&gt;&lt;br /&gt;public interface ISampleInterface&lt;br /&gt;{    // Property declaration:   &lt;br /&gt;string Name   &lt;br /&gt;{       &lt;br /&gt;get;      &lt;br /&gt; set;   &lt;br /&gt;}}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-9217876616288893329?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/9217876616288893329/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=9217876616288893329' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/9217876616288893329'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/9217876616288893329'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/11/properties.html' title='Properties'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-7502414625510471483</id><published>2008-11-11T09:15:00.000-08:00</published><updated>2009-03-11T09:28:54.372-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>ASP.NET Inerview Questions</title><content type='html'>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;1. Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;inetinfo.exe is theMicrosoft IIS server running, handling ASP.NET requests among other things.When an ASP.NET request is received (usually a file with .aspx extension), the ISAPI filter aspnet_isapi.dll takes care of it by passing the request tothe actual worker process aspnet_wp.exe. &lt;/p&gt;&lt;p&gt;&lt;strong&gt;2. What’s the difference between Response.Write() andResponse.Output.Write()?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Response.Output.Write() allows you to write formatted output.&lt;br /&gt;&lt;strong&gt;3. What methods are fired during the page load?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Init() - when the page is instantiatedLoad() - when the page is loaded into server memoryPreRender() - the brief moment before the page is displayed to the user as HTMLUnload() - when page finishes loading. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;4. When during the page processing cycle is ViewState available?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;After the Init() and before the Page_Load(), or OnLoad() for a control.&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;5. What namespace does the Web page belong in the .NET Framework class hierarchy?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;System.Web.UI.Page&lt;br /&gt;&lt;strong&gt;6. Where do you store the information about the user’s locale?&lt;/strong&gt;System.Web.UI.Page.Culture&lt;br /&gt;&lt;strong&gt;7. What’s the difference between Codebehind="MyCode.aspx.cs" andSrc="MyCode.aspx.cs"?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;CodeBehind is relevant to Visual Studio.NET only.&lt;br /&gt;&lt;strong&gt;8. What’s a bubbled event?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;When you have a complex control, like DataGrid, writing an event processing routine for each object (cell, button, row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of its constituents.&lt;br /&gt;&lt;strong&gt;9. Suppose you want a certain ASP.NET function executed on MouseOver for a certain button. Where do you add an event handler?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Add an OnMouseOver attribute to the button. Example: btnSubmit.Attributes.Add("onmouseover","someClientCodeHere();");&lt;br /&gt;&lt;strong&gt;10. What data types do the RangeValidator control support?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Integer, String, and Date.&lt;br /&gt;&lt;strong&gt;11. Explain the differences between Server-side and Client-side code?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Server-side code executes on the server. Client-side code executes in the client's browser.&lt;br /&gt;&lt;strong&gt;12. What type of code (server or client) is found in a Code-Behind class?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The answer is server-side code since code-behind is executed on the server. However, during the code-behind's execution on the server, it can render client-side code such as JavaScript to be processed in the clients browser. But just to be clear, code-behind executes on the server, thus making it server-side code.&lt;br /&gt;&lt;strong&gt;13. Should user input data validation occur server-side or client-side? Why?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;All user input data validation should occur on the server at a minimum. Additionally, client-side validation can be performed where deemed appropriate and feasable to provide a richer, more responsive experience for the user.&lt;br /&gt;&lt;strong&gt;14. What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Server.Transfer transfers page processing from one page directly to the next page without making a round-trip back to the client's browser. This provides a faster response with a little less overhead on the server. Server.Transfer does not update the clients url history list or current url. Response.Redirect is used to redirect the user's browser to another page or site. This performas a trip back to the client where the client's browser is redirected to the new page. The user's browser history list is updated to reflect the new address.&lt;br /&gt;&lt;strong&gt;15. Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Valid answers are:· A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.· A DataSet is designed to work without any continuing connection to the original data source.· Data in a DataSet is bulk-loaded, rather than being loaded on demand.· There's no concept of cursor types in a DataSet.· DataSets have no current record pointer You can use For Each loops to move through the data.· You can store many edits in a DataSet, and write them to the original data source in a single operation.· Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.&lt;br /&gt;&lt;strong&gt;16. What is the Global.asax used for?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The Global.asax (including the Global.asax.cs file) is used to implement application and session level events.&lt;br /&gt;&lt;strong&gt;17. What are the Application_Start and Session_Start subroutines used for?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;This is where you can set the specific variables for the Application and Session objects.&lt;br /&gt;&lt;strong&gt;18. Can you explain what inheritance is and an example of when you might use it?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;When you want to inherit (use the functionality of) another class. Example: With a base class named Employee, a Manager class could be derived from the Employee base class.&lt;br /&gt;&lt;strong&gt;19. Whats an assembly?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Assemblies are the building blocks of the .NET framework.&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconassembliesoverview.asp"&gt; Overview of assemblies from MSDN&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;20. Describe the difference between inline and code behind.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Inline code written along side the html in a page. Code-behind is code written in a separate file and referenced by the .aspx page.&lt;br /&gt;&lt;strong&gt;21. Explain what a diffgram is, and a good use for one?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The DiffGram is one of the two XML formats that you can use to render DataSet object contents to XML. A good use is reading database data to an XML file to be sent to a Web Service.&lt;br /&gt;&lt;strong&gt;22. Whats MSIL, and why should my developers need an appreciation of it if at all?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;MSIL is the Microsoft Intermediate Language. All .NET compatible languages will get converted to MSIL. MSIL also allows the .NET Framework to JIT compile the assembly on the installed computer.&lt;br /&gt;&lt;strong&gt;23. Which method do you invoke on the DataAdapter control to load your generated dataset with data?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The Fill() method.&lt;br /&gt;&lt;strong&gt;24. Can you edit data in the Repeater control?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;No, it just reads the information from its data source.&lt;br /&gt;&lt;strong&gt;25. Which template must you provide, in order to display data in a Repeater control?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;ItemTemplate.&lt;br /&gt;&lt;strong&gt;26. How can you provide an alternating color scheme in a Repeater control?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Use the AlternatingItemTemplate.&lt;br /&gt;&lt;strong&gt;27. What property must you set, and what method must you call in your code, in order to bind the data from a data source to the Repeater control?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;You must set the DataSource property and call the DataBind method.&lt;br /&gt;&lt;strong&gt;28. What base class do all Web Forms inherit from?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The Page class.&lt;br /&gt;&lt;strong&gt;29. Name two properties common in every validation control?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;ControlToValidate property and Text property.&lt;br /&gt;&lt;strong&gt;30. Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;DataTextField property.&lt;br /&gt;&lt;strong&gt;31. Which control would you use if you needed to make sure the values in two different controls matched?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;CompareValidator control.&lt;br /&gt;How many classes can a single .NET DLL contain?It can contain many classes.&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-7502414625510471483?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/7502414625510471483/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=7502414625510471483' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/7502414625510471483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/7502414625510471483'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/11/aspnet-inerview-questions.html' title='ASP.NET Inerview Questions'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-880550998717903062</id><published>2008-11-09T12:35:00.000-08:00</published><updated>2009-03-15T12:37:28.756-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Difference between int and Int32</title><content type='html'>&lt;strong&gt;Difference between int and Int32&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Int32 is the System.Int32 class, while int is an alias for System.Int32.&lt;br /&gt;The same applies for String (uppercase S) which is System.String, while string (lowercase S) is an alias for System.String.&lt;br /&gt;So basically int is the same thing as Int32, and string is the same thing as Int32. It's down to user's preference which one to use but most prefer to use int and string as they are easier to type and more familiar among C++ programmers.&lt;br /&gt;&lt;br /&gt;Its same only.&lt;br /&gt;&lt;br /&gt;Thing is int is alias name for Int32.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-880550998717903062?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/880550998717903062/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=880550998717903062' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/880550998717903062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/880550998717903062'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/11/difference-between-int-and-int32.html' title='Difference between int and Int32'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-5822822966974730366</id><published>2008-11-01T11:41:00.000-07:00</published><updated>2009-03-16T11:42:48.201-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET 2.0'/><title type='text'>I want to Cache based on HTTP header .How can I do that?</title><content type='html'>&lt;%@OutputCache … VaryByHeader=”UserAgent” %&gt; &lt;br /&gt;or &lt;br /&gt;&lt;%@ OutputCache … VaryByHeader=”Accept-Language” %&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-5822822966974730366?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/5822822966974730366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=5822822966974730366' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/5822822966974730366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/5822822966974730366'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/11/i-want-to-cache-based-on-http-header.html' title='I want to Cache based on HTTP header .How can I do that?'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-3435028332645357048</id><published>2008-10-25T11:51:00.000-07:00</published><updated>2009-03-15T11:55:36.207-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>To make a property, indexer readonly</title><content type='html'>To make the property or indexer as Read only provide only get property.  This makes the property of indexer as read onlyFor example&lt;br /&gt;class A&lt;br /&gt;{&lt;br /&gt;string s = "Welcome to C#";&lt;br /&gt;public char this [int index]&lt;br /&gt;{&lt;br /&gt;get { return s[index];&lt;br /&gt;} }&lt;br /&gt;public string GetS&lt;br /&gt;{&lt;br /&gt; get { return s; }&lt;br /&gt; }}&lt;br /&gt;To use this&lt;br /&gt;A obj = new A();&lt;br /&gt;char c = obj[3];&lt;br /&gt;obj[3] = 'a'; //Errorstring&lt;br /&gt;s = obj.GetS;&lt;br /&gt;obj.GetS = "Good Day"; //Error&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-3435028332645357048?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/3435028332645357048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=3435028332645357048' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3435028332645357048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3435028332645357048'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/10/to-make-property-indexer-readonly.html' title='To make a property, indexer readonly'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-6844415725203437140</id><published>2008-10-21T09:44:00.000-07:00</published><updated>2009-03-11T12:41:47.862-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft Exams'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>MCTS 70-431 Exam</title><content type='html'>Total Questions : 47 (35 objective type + 12 Simulations)&lt;br /&gt;Total Marks : 1000&lt;br /&gt;Pass Mark : 700&lt;br /&gt;Time : 205 min (180 min for exam and 25 min for instructions)&lt;br /&gt;Exam Fee : 50$&lt;br /&gt;&lt;br /&gt;The following are the list of useful materials to begin with,&lt;br /&gt;Refer this link for MSDN Virtual labs &lt;a href="http://msdn2.microsoft.com/en-us/virtuallabs/aa740409.aspx"&gt;http://msdn2.microsoft.com/en-us/virtuallabs/aa740409.aspx&lt;/a&gt;&lt;br /&gt;The New Generation of Microsoft Certifications &lt;a href="http://www.microsoft.com/learning/mcp/newgen/default.mspx"&gt;http://www.microsoft.com/learning/mcp/newgen/default.mspx&lt;/a&gt;&lt;br /&gt;Microsoft Next Generation of Certifications: Frequently Asked Questions &lt;a href="http://www.microsoft.com/learning/mcp/newgen/faq/default.mspx"&gt;http://www.microsoft.com/learning/mcp/newgen/faq/default.mspx&lt;/a&gt;&lt;br /&gt;Microsoft Certifications for IT Professionals &lt;a href="http://www.microsoft.com/learning/mcp/mcitp/default.mspx"&gt;http://www.microsoft.com/learning/mcp/mcitp/default.mspx&lt;/a&gt;&lt;br /&gt;SQL Server 2005 DBA Street Smarts &lt;a href="http://www.sybex.com/WileyCDA/SybexTitle/productCd-0470083492.html"&gt;http://www.sybex.com/WileyCDA/SybexTitle/productCd-0470083492.html&lt;/a&gt;&lt;br /&gt;MCTS 70-431 Self placed Training Kit &lt;a href="http://www.microsoft.com/MSPress/books/9364.aspx"&gt;http://www.microsoft.com/MSPress/books/9364.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-6844415725203437140?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/6844415725203437140/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=6844415725203437140' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/6844415725203437140'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/6844415725203437140'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/10/mcts-70-431-exam.html' title='MCTS 70-431 Exam'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-4779763820861209731</id><published>2008-10-16T11:13:00.000-07:00</published><updated>2009-03-16T11:15:01.664-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Why can not you specify accessibility modifier in Interface</title><content type='html'>An interface usually means a contract or a set of rules in order to interact with each other.&lt;br /&gt;So Interfaces members are automatically public.&lt;br /&gt;&lt;br /&gt;In this context public only valid. Other modifier private, protected are may not be useful for the global communication.&lt;br /&gt;&lt;br /&gt;Ex&lt;br /&gt;public interface Runnable {&lt;br /&gt;void run ();&lt;br /&gt;}&lt;br /&gt;This run function is automatically public&lt;br /&gt;&lt;br /&gt;To implement the interface&lt;br /&gt;class A :Runnable {&lt;br /&gt;&lt;br /&gt;public void run () {&lt;br /&gt;// Some Codes&lt;br /&gt;}&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-4779763820861209731?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/4779763820861209731/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=4779763820861209731' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4779763820861209731'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/4779763820861209731'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/10/why-can-not-you-specify-accessibility.html' title='Why can not you specify accessibility modifier in Interface'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-2773613875200589632</id><published>2008-10-11T12:20:00.000-07:00</published><updated>2009-03-15T12:26:27.663-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Anonymous method</title><content type='html'>&lt;p&gt;Ananymous methos are the usual delegate methods, but without a Name for that method.&lt;br /&gt;class SomeClass&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;delegate void SomeDelegate();&lt;/p&gt;&lt;p&gt;public void InvokeMethod()&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;SomeDelegate del = delegate() &lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;MessageBox.Show("Hello");&lt;/p&gt;&lt;p&gt;};&lt;/p&gt;&lt;p&gt;del();&lt;/p&gt;&lt;p&gt; }&lt;/p&gt;&lt;p&gt;}&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Passing Parameters to Anonymous Methods&lt;br /&gt;When defining an anonymous method with parameters, you define the parameter types and names after the delegate keyword just as if it were a conventional method. The method signature must match the definition of the delegate to which it is assigned. When invoking the delegate, you pass the parameter's values, just as with a normal delegate invocation:&lt;br /&gt;class SomeClass&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;delegate void SomeDelegate(string str);&lt;/p&gt;&lt;p&gt;public void InvokeMethod()&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;SomeDelegate del = delegate(string str)&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;MessageBox.Show(str);};&lt;/p&gt;&lt;p&gt;del("Hello");&lt;/p&gt;&lt;p&gt; }&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-2773613875200589632?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/2773613875200589632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=2773613875200589632' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2773613875200589632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2773613875200589632'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/10/anonymous-method.html' title='Anonymous method'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-3365641939104249175</id><published>2008-10-10T12:45:00.000-07:00</published><updated>2009-03-15T13:01:50.804-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Is Inheritance possible in Static class</title><content type='html'>&lt;strong&gt;Is Inheritance possible in Static class&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Static classes allows to create data and functions that can be accessed without creating an instance of the class. Static class members can be used to separate data and behavior that is independent of any object:&lt;br /&gt;&lt;br /&gt;It is useful when there is no data or behavior in the class that depends on object identity&lt;br /&gt;&lt;br /&gt;The main features of a static class are:&lt;br /&gt;&lt;br /&gt;&gt; They only contain static members.&lt;br /&gt;&gt; They cannot be instantiated.&lt;br /&gt;&gt; They are sealed.&lt;br /&gt;&gt; They cannot contain Instance Constructors&lt;br /&gt;&lt;br /&gt;Because of "static classes are sealed" they cannot be inherited.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-3365641939104249175?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/3365641939104249175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=3365641939104249175' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3365641939104249175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3365641939104249175'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/10/is-inheritance-possible-in-static-class.html' title='Is Inheritance possible in Static class'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-1759059286265179944</id><published>2008-10-02T12:49:00.000-07:00</published><updated>2009-03-15T13:01:20.923-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Is it possible to implement an interface to a structure. Is it possible to extend a struct. Is it possible to inherit a class to struct.</title><content type='html'>Is it possible to implement an interface to a structure. Is it possible to extend a struct. Is it possible to inherit a class to struct.&lt;br /&gt;&lt;br /&gt;It is possible to implement an interface to a Structure&lt;br /&gt;&lt;br /&gt;public interface ISpeak&lt;br /&gt;{&lt;br /&gt;void Say();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public struct A:ISpeak&lt;br /&gt;{&lt;br /&gt;public void Say()&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;} &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;But a struct cannot inherit from any type it can only implement the interface. Also a class cannot be inherited form a structure. by default a struct is sealed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-1759059286265179944?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/1759059286265179944/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=1759059286265179944' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/1759059286265179944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/1759059286265179944'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/10/is-it-possible-to-implement-interface.html' title='Is it possible to implement an interface to a structure. Is it possible to extend a struct. Is it possible to inherit a class to struct.'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-7369838252160566888</id><published>2008-10-02T12:06:00.000-07:00</published><updated>2009-03-15T12:09:25.258-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Generics</title><content type='html'>Generics are useful to maximize code reuse, type safety, and performance.It is possible to design classes and methods that defer the specification of one or more types until runtime.&lt;br /&gt;Example&lt;br /&gt;class List &lt;t&gt;&lt;br /&gt;{&lt;br /&gt;T[] tmp = new T[10];&lt;br /&gt;}&lt;br /&gt;class MyClass&lt;br /&gt;{&lt;br /&gt;static void Main(string[] args)&lt;br /&gt;{&lt;br /&gt;List&lt;int&gt; t = new List&lt;int&gt;();&lt;br /&gt;List&lt;string&gt; s = new List&lt;string&gt;();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Generics are mostly used with collections.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-7369838252160566888?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/7369838252160566888/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=7369838252160566888' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/7369838252160566888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/7369838252160566888'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/10/generics.html' title='Generics'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-9085358395987091894</id><published>2008-10-01T04:37:00.000-07:00</published><updated>2009-03-11T04:41:11.207-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>State Management Interview Questions</title><content type='html'>&lt;strong&gt;What is ViewState?&lt;/strong&gt;&lt;br /&gt;ViewState allows the state of objects (serializable) to be stored in a hidden field on the page. ViewState is transported to the client and back to the server, and is not stored on the server or any other external source. ViewState is used the retain the state of server-side objects between postabacks.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the lifespan for items stored in ViewState?&lt;/strong&gt;&lt;br /&gt;Item stored in ViewState exist for the life of the current page. This includes postbacks (to the same page). What does the "EnableViewState" property do? Why would I want it on or off?It allows the page to save the users input on a form across postbacks. It saves the server-side values for a given control into ViewState, which is stored as a hidden value on the page before sending the page to the clients browser. When the page is posted back to the server the server control is recreated with the state stored in viewstate.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are the different types of Session state management options available with ASP.NET?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;ASP.NET provides In-Process and Out-of-Process state management. In-Process stores the session in memory on the web server. This requires the a "sticky-server" (or no load-balancing) so that the user is always reconnected to the same web server. Out-of-Process Session state management stores data in an external data source. The external data source may be either a SQL Server or a State Server service. Out-of-Process state management requires that all objects stored in session are serializable.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-9085358395987091894?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/9085358395987091894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=9085358395987091894' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/9085358395987091894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/9085358395987091894'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/10/state-management-interview-questions.html' title='State Management Interview Questions'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-6081876822601764076</id><published>2008-09-14T11:14:00.000-07:00</published><updated>2009-03-13T11:20:21.270-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Sending data from javascript to a .Net object</title><content type='html'>In JavaScript you can use the call  "__doPostBack(variablename, value);" to perform the postback and send the variable along with it.  For instance,&lt;br /&gt;__doPostBack("FirstName","Tom");&lt;br /&gt;&lt;br /&gt;performs a postback, sending the variable "FirstName" with the value "Tom".&lt;br /&gt;In your code (C# in my case) you can read in this variable and use it as you will&lt;br /&gt;&lt;br /&gt;Page.ClientScript.GetPostBackEventReference(this,"arg");&lt;br /&gt;if (Page.IsPostBack)&lt;br /&gt;{   &lt;br /&gt;   string eventTarget = Page.Request["__EVENTTARGET"];  &lt;br /&gt;   string eventArgument = Page.Request["__EVENTARGUMENT"];  &lt;br /&gt;   if (eventTarget != String.Empty &amp;amp;&amp;amp; eventTarget == "FirstName")  &lt;br /&gt;   {     //do what you will with the eventArgument   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Note that you would replace "FirstName" in the second if statement with the name of your variable you used in the "__doPostBack" statement.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-6081876822601764076?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/6081876822601764076/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=6081876822601764076' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/6081876822601764076'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/6081876822601764076'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/09/sending-data-from-javascript-to-net.html' title='Sending data from javascript to a .Net object'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-3002963258076017375</id><published>2008-09-10T11:33:00.000-07:00</published><updated>2009-03-15T11:35:29.773-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Value type and reference type</title><content type='html'>&lt;p&gt;&lt;strong&gt;value type and reference type&lt;/strong&gt;&lt;br /&gt;A data type is a value type if it holds the data within its own memory allocation. A reference type contains a pointer to another memory location that holds the data.&lt;br /&gt;Value Types&lt;br /&gt;Value types include the following:&lt;br /&gt;·         All numeric data types&lt;br /&gt;·         Boolean, Char, and Date&lt;br /&gt;·         All structures, even if their members are reference types&lt;br /&gt;·         Enumerations, since their underlying type is always SByte, Short, Integer, Long, Byte, UShort, UInteger, or ULong&lt;br /&gt;Reference Types&lt;br /&gt;Reference types include the following:&lt;br /&gt;·         String&lt;br /&gt;·         All arrays, even if their elements are value types&lt;br /&gt;·         Class types, such as &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.form(VS.80).aspx"&gt;Form&lt;/a&gt;&lt;br /&gt;·         Delegates&lt;br /&gt;Elements That Are Not Types&lt;br /&gt;The following programming elements do not qualify as types, because you cannot specify any of them as a data type for a declared element:&lt;br /&gt;·         Namespaces&lt;br /&gt;·         Modules&lt;br /&gt;·         Events&lt;br /&gt;·         Properties and procedures&lt;br /&gt;·         Variables, constants, and fields&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-3002963258076017375?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/3002963258076017375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=3002963258076017375' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3002963258076017375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3002963258076017375'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/09/value-type-and-reference-type.html' title='Value type and reference type'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-6952201570893293249</id><published>2008-09-09T12:12:00.000-07:00</published><updated>2009-03-15T12:20:22.634-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>What is covariance and contravariance. Did Delegate and method overriding support these.</title><content type='html'>&lt;p&gt;&lt;strong&gt;What is covariance and contravariance. Did Delegate and method overriding support these.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt; Covariance and contravariance provide a degree of flexibility when matching method signatures with delegate types. Covariance permits a method to have a more derived return type than what is defined in the delegate. Contravariance permits a method with parameter types that are less derived than in the delegate type.&lt;/p&gt;&lt;p&gt;Covariance&lt;/p&gt;&lt;p&gt;class Mammals&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;class Dogs : Mammals&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;class Program&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;// Define the delegate.&lt;/p&gt;&lt;p&gt;public delegate Mammals HandlerMethod();&lt;/p&gt;&lt;p&gt;public static Mammals FirstHandler()&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;return null;&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;public static Dogs SecondHandler(){&lt;/p&gt;&lt;p&gt;return null;&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;static void Main()&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;HandlerMethod handler1 = FirstHandler;&lt;/p&gt;&lt;p&gt;// Covariance allows this delegate.&lt;/p&gt;&lt;p&gt;HandlerMethod handler2 = SecondHandler;&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;ContravarianceSystem.DateTime lastActivity;&lt;/p&gt;&lt;p&gt;public Form1()&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;InitializeComponent();&lt;/p&gt;&lt;p&gt;lastActivity = new System.DateTime();&lt;/p&gt;&lt;p&gt;this.textBox1.KeyDown += this.MultiHandler; &lt;/p&gt;&lt;p&gt;//works with KeyEvent Args&lt;/p&gt;&lt;p&gt;this.button1.MouseClick += this.MultiHandler;&lt;/p&gt;&lt;p&gt; //works with MouseEventArgs&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;// Event hander for any event with an EventArgs or// derived class in the second parameter&lt;/p&gt;&lt;p&gt;private void MultiHandler(object sender, System.EventArgs e)&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;lastActivity = System.DateTime.Now;&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;http://msdn.microsoft.com/en-us/library/ms173174(VS.80).aspx&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-6952201570893293249?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/6952201570893293249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=6952201570893293249' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/6952201570893293249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/6952201570893293249'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/09/what-is-covariance-and-contravariance.html' title='What is covariance and contravariance. Did Delegate and method overriding support these.'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-3186903597174824040</id><published>2008-09-05T13:05:00.000-07:00</published><updated>2009-03-15T13:07:19.039-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Different properties provided by Object-oriented systems</title><content type='html'>&lt;strong&gt;Different properties provided by Object-oriented systems&lt;/strong&gt;&lt;br /&gt;1. Read-only Property&lt;br /&gt;2. Write-Only Property&lt;br /&gt;3. Read Write Property&lt;br /&gt;4. Static Properties&lt;br /&gt;4. Auto-implemented properties&lt;br /&gt;&lt;br /&gt;If you define a property with only a get accessor, that property will be read-only. Likewise, if you define a property with only a set accessor, you’ll end up with a write-only property. And lastly, a property with both accessors is a read-write property&lt;br /&gt;&lt;br /&gt;Read-Write Property&lt;br /&gt;public string CarModel&lt;br /&gt;{&lt;br /&gt;get { return model; }&lt;br /&gt;set { model = value;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Read Only&lt;br /&gt;public string CarModel&lt;br /&gt;{&lt;br /&gt;get { return CarModel; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Write Only&lt;br /&gt;public string CarModel&lt;br /&gt;{&lt;br /&gt;set { model = value;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Auto-implemented properties is the C# 3.0 new feature that make property-declaration more concise. It helps you to save some of your time for typing a lot of codes. Please take a look the following code to know how it looks like.&lt;br /&gt;&lt;br /&gt;class Car&lt;br /&gt;{&lt;br /&gt;public string Speed &lt;br /&gt;{ &lt;br /&gt;get; set; &lt;br /&gt;}&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-3186903597174824040?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/3186903597174824040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=3186903597174824040' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3186903597174824040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3186903597174824040'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/09/different-properties-provided-by-object.html' title='Different properties provided by Object-oriented systems'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-5332191986036147803</id><published>2008-09-03T01:05:00.000-07:00</published><updated>2009-03-11T04:22:56.906-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>differences strored procedures and triggers</title><content type='html'>Stored Procedure:A stored procedure can be created with no parameters, IN parameters, OUT parameters. There can be many parameters per stored procedure. One has to manually call this Object to do some actions.&lt;br /&gt;&lt;br /&gt;Trigger:It is a fragment of code that tells Database to fire or run BEFORE or AFTER a table is modified. It has the power to make sure that a column is filled in with default information make sure that an audit row is inserted into another table after finding that the new information is inconsistent with other stuff in the database.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-5332191986036147803?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/5332191986036147803/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=5332191986036147803' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/5332191986036147803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/5332191986036147803'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/09/differences-strored-procedures-and.html' title='differences strored procedures and triggers'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-2767996074581910440</id><published>2008-08-30T04:02:00.000-07:00</published><updated>2009-03-11T04:04:29.046-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>What is a concatenated primary key</title><content type='html'>Each table has one and only one primary key, which can consist of one or many columns. A concatenated primary key comprises two or more columns. In a single table, you might find several columns, or groups of columns, that might serve as a primary key and are called candidate keys. A table can have more than one candidate key, but only one candidate key can become the primary key for that table&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-2767996074581910440?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/2767996074581910440/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=2767996074581910440' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2767996074581910440'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2767996074581910440'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/08/what-is-concatenated-primary-key.html' title='What is a concatenated primary key'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-1797522397629437179</id><published>2008-08-19T02:58:00.000-07:00</published><updated>2009-03-11T03:59:57.178-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>differnce between @@sqlstatus and @@fetch_status</title><content type='html'>The @@sqlstatus global variable holds status information (warning exceptions) resulting from the execution of a fetch statement. Its value reflects the last cursor fetched.&lt;br /&gt;&lt;br /&gt;The @@fetch_status global variable provides information about whether fetch is executed successfully in a scrollable cursor&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-1797522397629437179?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/1797522397629437179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=1797522397629437179' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/1797522397629437179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/1797522397629437179'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/08/differnce-between-sqlstatus-and.html' title='differnce between @@sqlstatus and @@fetch_status'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-6657211982885327604</id><published>2008-08-15T11:28:00.000-07:00</published><updated>2009-03-15T11:30:20.603-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Generics</title><content type='html'>&lt;strong&gt;Generics&lt;br /&gt;&lt;/strong&gt;Generics are classes or methods that work uniformly on values of different typesGenerics also called as Parametric Polymorphism, it is similar to the concept of Templates in c++, which is lacked in .Net frame work1.1 and is new feature ofC# 2.0. Generics allow you to realize type safety at compile time. They allow you to create a data structure without committing to a specific data type. When the data structure is used. Even though C# 2.0 Generics are similar to Templates in c++, but we can’t compare both because generics have some additional benefits and it solved the problems like Developer Confusion.&lt;br /&gt;Generics are useful for writing efficient type independent code particularly where the type might include value types .the obvious application is container classes.The .Net 2.0 class library includes a suite of generic container classes in the System.Collection.Generic namespace&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-6657211982885327604?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/6657211982885327604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=6657211982885327604' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/6657211982885327604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/6657211982885327604'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/08/generics.html' title='Generics'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-2897852701601819844</id><published>2008-08-10T11:30:00.000-07:00</published><updated>2009-03-15T11:32:48.025-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>New Features in C#2.0</title><content type='html'>&lt;strong&gt;New Features in c# 2.0&lt;/strong&gt;&lt;br /&gt;The following are the new features in c# 2.0&lt;br /&gt;1. Generics&lt;br /&gt;2. Partial Classes&lt;br /&gt;3. Iterators&lt;br /&gt;4. Anonymous Methods&lt;br /&gt;5. Property Visibility&lt;br /&gt;6. Static Classes&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-2897852701601819844?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/2897852701601819844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=2897852701601819844' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2897852701601819844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2897852701601819844'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/08/new-features-in-c20.html' title='New Features in C#2.0'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-9134005367279481689</id><published>2008-08-08T11:04:00.000-07:00</published><updated>2009-03-11T11:11:49.975-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><title type='text'>Sql Server Exception Handling using Try..Catch</title><content type='html'>Even though @@Error is good for handling errors, it cannot handle exceptions, indeed in sql server 2000, there are no ways to do this. In SQL server 2005, Microsoft introduced a new feature “try catch” dedicated for this purpose. For example the divide by zero exception, even before the @@Error returns the error id, SQL throws an exception.&lt;br /&gt;&lt;br /&gt;DECLARE @i int , @j int&lt;br /&gt;SELECT @i =100, @j =0&lt;br /&gt;SELECT @i/@j&lt;br /&gt;Print @@Error&lt;br /&gt;&lt;br /&gt;Now let us see, how to handle this is SQL Server 2005. SQL server 2005 introduces new Statements to handle this.&lt;br /&gt;BEGIN TRY&lt;br /&gt;&lt;statements&gt;&lt;br /&gt;END TRYBEGIN CATCH&lt;br /&gt;&lt;statements&gt;&lt;br /&gt;END CATCH&lt;br /&gt;&lt;br /&gt;Don’t put any other statements in between the “End TRY and the ‘Begin catch’ statements. For example consider the modified version of the above code.&lt;br /&gt;DECLARE @i int , @j int&lt;br /&gt;SELECT @i =100, @j =0&lt;br /&gt;BEGIN TRY&lt;br /&gt;SELECT @i/@j&lt;br /&gt;END TRY&lt;br /&gt;BEGIN CATCH&lt;br /&gt;SELECT ERROR_NUMBER() as ErrorNo,&lt;br /&gt;                 ERROR_MESSAGE() as ErrMessage&lt;br /&gt;END CATCH&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-9134005367279481689?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/9134005367279481689/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=9134005367279481689' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/9134005367279481689'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/9134005367279481689'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/08/sql-server-exception-handling-using.html' title='Sql Server Exception Handling using Try..Catch'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-2340580191959293952</id><published>2008-08-02T03:53:00.000-07:00</published><updated>2009-03-11T03:55:51.547-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>What is a join and explain different types of joins</title><content type='html'>Joins are used in queries to explain how different tables are related.Joins also let you select data from a table depending upon data from another table.&lt;br /&gt;Types of joins: INNER JOINs, OUTER JOINs, CROSS JOINs.OUTER JOINs are further classified as LEFT OUTER JOINS, RIGHT OUTER JOINS and FULL OUTER JOINS.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-2340580191959293952?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/2340580191959293952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=2340580191959293952' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2340580191959293952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2340580191959293952'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/08/what-is-join-and-explain-different.html' title='What is a join and explain different types of joins'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-3414384924101917044</id><published>2008-08-01T03:47:00.000-07:00</published><updated>2009-03-11T03:52:07.763-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Differences between primarykey and uniquekey</title><content type='html'>The Major differences between Primary Key and Unique Key are:&lt;br /&gt;1) Primary Key doesn't allow null values, But Unique key does all nulls(Only One per key).&lt;br /&gt;2) You can have No.Of Unique Keys on a single table, but you can have atmost only one primary key.&lt;br /&gt;3) Primary Keys are used to define Referential Integrity Constraints.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-3414384924101917044?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/3414384924101917044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=3414384924101917044' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3414384924101917044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3414384924101917044'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/08/differences-between-primarykey-and.html' title='Differences between primarykey and uniquekey'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-903304742671730893</id><published>2008-07-22T11:16:00.000-07:00</published><updated>2009-03-16T11:18:11.079-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Nested Classes</title><content type='html'>Some times you need to define a class only to serve other class and there are no other reasons to make it visible. The best way to implement this is through nested classes. A nested class is a class defined within the scope of another class. &lt;br /&gt;&lt;br /&gt;Consider the following example: &lt;br /&gt;public class Outer {&lt;br /&gt;public Outer(int a) {&lt;br /&gt;A = a;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class Nested {&lt;br /&gt;public void DisplayA(Outer o) {&lt;br /&gt;System.Console.WriteLine(o.A);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private int A;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;As it shows, it is entirely possible for the member of a class to be another user-defined type. If you read the above code snippet closely, you can see that the nested class' method DisplayA is trying to access the outer class private variable A. Nested classes have the advantage of access to all the members of the outer class. &lt;br /&gt;&lt;br /&gt;The nested class in the example has a public access modifier and it can be instantiated within the scope of the outer class. For example: &lt;br /&gt;&lt;br /&gt;Outer.Nested n1 = new Outer.Nested();&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-903304742671730893?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/903304742671730893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=903304742671730893' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/903304742671730893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/903304742671730893'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/07/nested-classes.html' title='Nested Classes'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-2459139800423131590</id><published>2008-07-16T11:22:00.000-07:00</published><updated>2009-03-16T11:24:19.327-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Inerview Questions'/><title type='text'>Creating objects in JavaScript</title><content type='html'>function myobject() &lt;br /&gt;{&lt;br /&gt; this.containedValue = 0;&lt;br /&gt; this.othercontainedValue = 0;&lt;br /&gt; this.anothercontainedValue = 0;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;var mything = new myobject();&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-2459139800423131590?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/2459139800423131590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=2459139800423131590' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2459139800423131590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/2459139800423131590'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/07/creating-objects-in-javascript.html' title='Creating objects in JavaScript'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-3926430375781395685</id><published>2008-07-15T12:41:00.000-07:00</published><updated>2009-03-15T12:43:06.891-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Output parameter and parameter array.</title><content type='html'>Output parameter and parameter array.&lt;br /&gt;&lt;br /&gt;Out paramater is used for passed by reference. It is similar to ref keyword except ref requires the variable to be initialized before use.&lt;br /&gt;&lt;br /&gt;Example &lt;br /&gt;public static void Sum(int a, int b, out int c)&lt;br /&gt;{&lt;br /&gt;c = a + b;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int a;&lt;br /&gt;&lt;br /&gt;Sum(10, 20, out a);&lt;br /&gt;&lt;br /&gt;but params lets you to specify a method that taking invariable number of input parameters&lt;br /&gt;&lt;br /&gt;Example &lt;br /&gt;&lt;br /&gt;public static int Sum(params int [] Input)&lt;br /&gt;{&lt;br /&gt;int Total=0;&lt;br /&gt;for (int i = 0; i &lt; Input.Length; i++) Total += Input[i];&lt;br /&gt;return Total;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int Total = Sum(100, 200, 200, 300);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-3926430375781395685?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/3926430375781395685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=3926430375781395685' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3926430375781395685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3926430375781395685'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/07/output-parameter-and-parameter-array.html' title='Output parameter and parameter array.'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-3747519568700779269</id><published>2008-07-15T12:39:00.000-07:00</published><updated>2009-03-15T12:41:11.502-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Difference between passing a value object by reference and a reference object by value</title><content type='html'>Difference between passing a value object by reference and a reference object by value&lt;br /&gt;&lt;br /&gt;Value types directly contain their data which are either allocated on the stack or allocated in-line in a structure.&lt;br /&gt;Reference types store a reference to the value's memory address, and are allocated on the heap.&lt;br /&gt;Reference types can be self-describing types, pointer types, or interface types.&lt;br /&gt;Variables that are value types each have their own copy of the data, and therefore operations on one variable do not affect other variables. Variables that are reference types can refer to the same&lt;br /&gt;object; therefore, operations on one variable can affect the same object referred to by another variable. All types derive from the System.Object base type&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-3747519568700779269?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/3747519568700779269/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=3747519568700779269' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3747519568700779269'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/3747519568700779269'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2008/07/difference-between-passing-value-object.html' title='Difference between passing a value object by reference and a reference object by value'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-297073819615100816.post-1837797603004202286</id><published>2008-07-04T03:34:00.000-07:00</published><updated>2009-03-11T03:45:41.111-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Active transactions for the current connection</title><content type='html'>@@TRANCOUNT&lt;br /&gt;&lt;br /&gt;&lt;a name="_.4040.trancount"&gt;&lt;/a&gt;Returns the number of active transactions for the current connection.&lt;br /&gt;&lt;br /&gt;The BEGIN TRANSACTION statement increments @@TRANCOUNT by 1. ROLLBACK TRANSACTION decrements @@TRANCOUNT to 0, except for ROLLBACK TRANSACTION savepoint_name, which does not affect @@TRANCOUNT. COMMIT TRANSACTION or COMMIT WORK decrement @@TRANCOUNT by 1.&lt;br /&gt;&lt;br /&gt;BEGIN TRANSACTION&lt;br /&gt;UPDATE authors SET au_lname = upper(au_lname)&lt;br /&gt;WHERE au_lname = 'White'&lt;br /&gt;IF @@ROWCOUNT = 2&lt;br /&gt;COMMIT TRAN&lt;br /&gt;IF @@TRANCOUNT &gt; 0&lt;br /&gt;BEGIN&lt;br /&gt;PRINT 'A transaction needs to be rolled back'&lt;br /&gt;ROLLBACK TRAN&lt;br /&gt;END&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/297073819615100816-1837797603004202286?l=saikatchoudhury.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://saikatchoudhury.blogspot.com/feeds/1837797603004202286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=297073819615100816&amp;postID=1837797603004202286' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/1837797603004202286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/297073819615100816/posts/default/1837797603004202286'/><link rel='alternate' type='text/html' href='http://saikatchoudhury.blogspot.com/2009/03/active-transactions-for-current.html' title='Active transactions for the current connection'/><author><name>Saikat Choudhury</name><uri>http://www.blogger.com/profile/05209604101430272912</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
