<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5127580816761899505</id><updated>2024-09-08T04:54:49.467-07:00</updated><category term=".net"/><category term="Asp.net Questions and answers"/><category term="SQL"/><category term="C#"/><category term="Tips"/><title type='text'>Techie Ideas</title><subtitle type='html'>An Excellent,Innovative and simple ideas given by techies</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://techieideas.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://techieideas.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Kumar</name><uri>http://www.blogger.com/profile/10464926383302933718</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5127580816761899505.post-351098604548702012</id><published>2010-11-03T02:59:00.000-07:00</published><updated>2010-11-03T02:59:15.547-07:00</updated><title type='text'>Sharepoint site 2010</title><content type='html'>&lt;div id=&quot;fastsharepoint_345345345d45ggdf435&quot;&gt;I&#39;m taking a &lt;a href=&quot;http://www.fastsharepoint.com/sharepointdevelopment.aspx&quot; _fcksavedurl=&quot;http://www.fastsharepoint.com/sharepointdevelopment.aspx&quot;&gt;sharepoint  development&lt;/a&gt; course for free from FastSharePoint.com. Go to &lt;a href=&quot;http://www.fastsharepoint.com&quot; _fcksavedurl=&quot;http://www.fastsharepoint.com&quot;&gt;FastSharePoint.com&lt;/a&gt; for free &lt;a href=&quot;http://www.fastsharepoint.com/sharepointtraining.aspx&quot; _fcksavedurl=&quot;http://www.fastsharepoint.com/sharepointtraining.aspx&quot;&gt;SharePoint  training&lt;/a&gt;. &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techieideas.blogspot.com/feeds/351098604548702012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techieideas.blogspot.com/2010/11/sharepoint-site-2010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/351098604548702012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/351098604548702012'/><link rel='alternate' type='text/html' href='http://techieideas.blogspot.com/2010/11/sharepoint-site-2010.html' title='Sharepoint site 2010'/><author><name>Kumar</name><uri>http://www.blogger.com/profile/10464926383302933718</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5127580816761899505.post-3306514773751110627</id><published>2010-03-19T11:21:00.000-07:00</published><updated>2010-03-19T11:21:53.608-07:00</updated><title type='text'>How to Find Number of Columns in a Table</title><content type='html'>Below script find out how many columns are there in&amp;nbsp; a table&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SELECT COUNT(1) &#39;No of Column(s)&#39; FROM SYS.SYSCOLUMNS &lt;br /&gt;
WHERE ID = OBJECT_ID(&#39;TableName&#39;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Happy Quering</content><link rel='replies' type='application/atom+xml' href='http://techieideas.blogspot.com/feeds/3306514773751110627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techieideas.blogspot.com/2010/03/how-to-find-number-of-columns-in-table.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/3306514773751110627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/3306514773751110627'/><link rel='alternate' type='text/html' href='http://techieideas.blogspot.com/2010/03/how-to-find-number-of-columns-in-table.html' title='How to Find Number of Columns in a Table'/><author><name>Kumar</name><uri>http://www.blogger.com/profile/10464926383302933718</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5127580816761899505.post-3553823880783573487</id><published>2010-03-19T06:43:00.001-07:00</published><updated>2010-03-19T06:51:00.376-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>Sleep for 1 min in SQL SERVER 2005</title><content type='html'>We just want to delay our query for one min.&lt;br /&gt;
&lt;br /&gt;
To achieve that one we need write the below script&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;print getdate()&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;waitfor delay &#39;00:01&#39;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;print getdate()&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Mar 19 2010 &amp;nbsp;6:37PM&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Mar 19 2010 &amp;nbsp;6:38PM&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Happy Querying</content><link rel='replies' type='application/atom+xml' href='http://techieideas.blogspot.com/feeds/3553823880783573487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techieideas.blogspot.com/2010/03/sleep-for-1-min-in-sql-server-2005.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/3553823880783573487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/3553823880783573487'/><link rel='alternate' type='text/html' href='http://techieideas.blogspot.com/2010/03/sleep-for-1-min-in-sql-server-2005.html' title='Sleep for 1 min in SQL SERVER 2005'/><author><name>Kumar</name><uri>http://www.blogger.com/profile/10464926383302933718</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5127580816761899505.post-2548284461001521705</id><published>2010-03-19T05:52:00.000-07:00</published><updated>2010-03-19T05:54:12.261-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>Multiple Columns as Primary Key - SQL Server 2005</title><content type='html'>Steps to make multiple Columns of a table in SQL Server Management Studio&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Go to Table Design.&lt;/li&gt;
&lt;li&gt;Select a Column first to define it as Primary key.&lt;/li&gt;
&lt;li&gt;To select multiple columns, hold down the CTRL key while you click the other columns.&lt;/li&gt;
&lt;li&gt;Right-click the row selector for the column and select Set Primary Key.&lt;/li&gt;
&lt;li&gt;A primary key index, named &quot;PK_&quot; followed by the table name is automatically created.&lt;/li&gt;
&lt;/ol&gt;Hope this helps you&lt;br /&gt;
&lt;br /&gt;
Happy Coding</content><link rel='replies' type='application/atom+xml' href='http://techieideas.blogspot.com/feeds/2548284461001521705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techieideas.blogspot.com/2010/03/multiple-columns-as-primary-key-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/2548284461001521705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/2548284461001521705'/><link rel='alternate' type='text/html' href='http://techieideas.blogspot.com/2010/03/multiple-columns-as-primary-key-sql.html' title='Multiple Columns as Primary Key - SQL Server 2005'/><author><name>Kumar</name><uri>http://www.blogger.com/profile/10464926383302933718</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5127580816761899505.post-5807319270802276041</id><published>2010-03-17T05:15:00.000-07:00</published><updated>2010-03-17T05:18:08.829-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>Update Tables Using Inner Join</title><content type='html'>You will come across the problem to update a table with the help of joining two tables.&lt;br /&gt;
&lt;br /&gt;
Below is the steps to update a table using joins&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Perform a update say UPDATE&lt;/li&gt;
&lt;li&gt;Join the tables with condition say FIRSTTABLE AS A INNER JOIN SECONDTABLE AS B ON A.FIELDNAME = B.FIELDNAME&lt;/li&gt;
&lt;li&gt;Write the condition which is going to change or update say SET A.FIELDNAME=2, B.FIELDNAME=5&lt;/li&gt;
&lt;li&gt;If you have a where condition then add it say WHERE A.FIELDNAME=10&lt;/li&gt;
&lt;/ol&gt;Combine the above steps and form a query as below&lt;br /&gt;
UPDATE&lt;br /&gt;
FIRSTTABLE AS A INNER JOIN SECONDTABLE AS B&lt;br /&gt;
ON A.FIELDNAME = B.FIELDNAME&lt;br /&gt;
SET A.FIELDNAME=2, B.FIELDNAME=5&lt;br /&gt;
WHERE A.FIELDNAME=10&lt;br /&gt;
&lt;br /&gt;
Simply cool&lt;br /&gt;
&lt;br /&gt;
Hope this helped you.&lt;br /&gt;
&lt;br /&gt;
Happy Coding,&lt;br /&gt;
Kumar</content><link rel='replies' type='application/atom+xml' href='http://techieideas.blogspot.com/feeds/5807319270802276041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techieideas.blogspot.com/2010/03/update-table-using-inner-join.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/5807319270802276041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/5807319270802276041'/><link rel='alternate' type='text/html' href='http://techieideas.blogspot.com/2010/03/update-table-using-inner-join.html' title='Update Tables Using Inner Join'/><author><name>Kumar</name><uri>http://www.blogger.com/profile/10464926383302933718</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5127580816761899505.post-1037052545558618433</id><published>2010-02-04T12:32:00.000-08:00</published><updated>2010-02-04T12:32:21.636-08:00</updated><title type='text'>Advantages and Disadvantages of LINQ</title><content type='html'>LINQ (Language Integrated Query) is a Microsoft programming model and methodology that gives a formal query capabilities into Microsoft .NET-based programming languages.&lt;br /&gt;
&lt;br /&gt;
It offers a compact, expressive, and intelligible syntax for manipulating data. The real value of LINQ comes is to apply the same query to an SQL database, a DataSet, an array of objects in memory and to many other types of data as well. It requires the presence of specific language extensions.&lt;br /&gt;
&lt;br /&gt;
LINQ may be used to access all types of data, whereas embedded SQL is limited to addressing only databases that can handle SQL queries.&lt;br /&gt;
&lt;br /&gt;
Below are the advantages and Disadvantages of LINQ&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Advantages&lt;/b&gt;:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&amp;nbsp;It is a cleaner and typesafety.&lt;/li&gt;
&lt;li&gt;It is checked by the compiler instead of at runtime&lt;/li&gt;
&lt;li&gt;It can be debugged easily.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;It can be used against any datatype - it isn&#39;t limited to relational databases, you can also use it against XML, regular objects.&lt;/li&gt;
&lt;li&gt;It can able to query not just tables in a relational database but also text files and XML files.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;b&gt;Disadvantages:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;LINQ sends the entire query to the DB hence takes much network traffic but the stored procedures sends only argument and the stored procedure name. It will become really bad if the queries are very complex.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Preformance is degraded if we don&#39;t write the linq query correctly.&lt;/li&gt;
&lt;li&gt;If you need to make changes to the way you do data access, you need to recompile, version, and redeploy your assembly.&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
Happy Coding and Learning</content><link rel='replies' type='application/atom+xml' href='http://techieideas.blogspot.com/feeds/1037052545558618433/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techieideas.blogspot.com/2010/02/advantages-and-disadvantages-of-linq.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/1037052545558618433'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/1037052545558618433'/><link rel='alternate' type='text/html' href='http://techieideas.blogspot.com/2010/02/advantages-and-disadvantages-of-linq.html' title='Advantages and Disadvantages of LINQ'/><author><name>Kumar</name><uri>http://www.blogger.com/profile/10464926383302933718</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5127580816761899505.post-2433438565123741340</id><published>2010-01-29T09:15:00.000-08:00</published><updated>2010-01-29T09:28:59.257-08:00</updated><title type='text'>Convert Web Page to ASP.net User Control</title><content type='html'>Some situation comes into picture where we want to change the web page to User control.&lt;br /&gt;
&lt;br /&gt;
Steps to convert asp.net web page to user control.&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Rename to the file extenstion (&lt;b&gt;.aspx&lt;/b&gt;) to &amp;nbsp;a &lt;b&gt;.ascx&lt;/b&gt; extension.&lt;/li&gt;
&lt;li&gt;Remove html, head, body, form tags from the page.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Change the &quot;@ Page&quot; directive to a &quot;@ Control&quot; directive.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Remove all attributes of the &quot;@ Control&quot; directive, except &amp;nbsp;&lt;b&gt;Language&lt;/b&gt;, &lt;b&gt;AutoEventWireup&lt;/b&gt;, &lt;b&gt;CodeFile&lt;/b&gt;, and &lt;b&gt;Inherits&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Need to change the Inherits to have your new UserControl code behind file&#39;s name.&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&amp;lt;%@ Control Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeFile=&quot;UserControlFilename.ascx.cs&quot;&amp;nbsp;&amp;nbsp;Inherits=&quot;UserControlFileName&quot; %&amp;gt;&lt;/i&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Close and re-open the file to make squiggles go away.&lt;/li&gt;
&lt;li&gt;Open the code behind file and change the class it inherits from to UserControl, and the class name to match your .ascx file.&lt;br /&gt;
public partial class UserControlFileName : System.Web.UI.&lt;b&gt;UserControl&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div&gt;Hope this helps for some body.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techieideas.blogspot.com/feeds/2433438565123741340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techieideas.blogspot.com/2010/01/convert-web-page-to-aspnet-user-control.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/2433438565123741340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/2433438565123741340'/><link rel='alternate' type='text/html' href='http://techieideas.blogspot.com/2010/01/convert-web-page-to-aspnet-user-control.html' title='Convert Web Page to ASP.net User Control'/><author><name>Kumar</name><uri>http://www.blogger.com/profile/10464926383302933718</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5127580816761899505.post-7190082144548017600</id><published>2010-01-27T00:24:00.001-08:00</published><updated>2010-01-27T00:24:39.141-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net Questions and answers"/><title type='text'>What is Multi-Targeting in .net?</title><content type='html'>In the previous version of Visual Studio, each Visual Studio release supports to a specific version of the .NET Framework. For example, VS 2002 only worked with .NET 1.0, VS 2003 only worked with .NET 1.1, and VS 2005 only worked with .NET 2.0. &lt;br /&gt;
&lt;br /&gt;
Now with the major change in VS2008 is to support &quot;&lt;b&gt;Multi-Targeting&lt;/b&gt; &quot; &lt;br /&gt;
Visual Studio 2008 is used to create projects that target .NET Framework version 2.0, 3.0, or 3.5. is what we call as &quot;Multi-Targeting&quot;.</content><link rel='replies' type='application/atom+xml' href='http://techieideas.blogspot.com/feeds/7190082144548017600/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techieideas.blogspot.com/2010/01/what-is-multi-targeting-in-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/7190082144548017600'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/7190082144548017600'/><link rel='alternate' type='text/html' href='http://techieideas.blogspot.com/2010/01/what-is-multi-targeting-in-net.html' title='What is Multi-Targeting in .net?'/><author><name>Kumar</name><uri>http://www.blogger.com/profile/10464926383302933718</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5127580816761899505.post-6371005178470354418</id><published>2010-01-12T04:20:00.000-08:00</published><updated>2010-01-12T04:20:31.294-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Tips"/><title type='text'>What is Tracing and how to enable it?</title><content type='html'>Tracing helps understand which control uses more view state,&amp;nbsp; start/end of PreInit etc. This type of information appears at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
Tracing can be enable at &lt;b&gt;Page level&lt;/b&gt; and &lt;b&gt;Application Level&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Page Level:&lt;/b&gt; You can add a&amp;nbsp;&lt;strong&gt;Trace=&quot;true&quot; &lt;/strong&gt;in the page directive.&lt;br /&gt;
&amp;lt;%@ Page Language=&quot;C#&quot;&amp;nbsp; Trace=&quot;true&quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Application Level: &lt;span style=&quot;font-weight: normal;&quot;&gt;The user&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;nbsp;can enable &lt;strong&gt;Application level tracing&lt;/strong&gt; in the &lt;strong&gt;Web.config&lt;/strong&gt; file.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;By doing this the user will get trace information for all pages in your application.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;configuration&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;system.web&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;trace enabled=&quot;true&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/system.web&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Happy Tracing.</content><link rel='replies' type='application/atom+xml' href='http://techieideas.blogspot.com/feeds/6371005178470354418/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techieideas.blogspot.com/2010/01/what-is-tracing-and-how-to-enable-it.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/6371005178470354418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/6371005178470354418'/><link rel='alternate' type='text/html' href='http://techieideas.blogspot.com/2010/01/what-is-tracing-and-how-to-enable-it.html' title='What is Tracing and how to enable it?'/><author><name>Kumar</name><uri>http://www.blogger.com/profile/10464926383302933718</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5127580816761899505.post-3654798179618458977</id><published>2009-12-29T23:11:00.000-08:00</published><updated>2009-12-29T23:11:16.339-08:00</updated><title type='text'>C# 3.0 new Features - Part 2</title><content type='html'>&lt;div class=&quot;MsoNormal&quot;&gt;Continuing from part 1, here I will go one more step further and explain about Lambda Expression basics in C# 3.0 which will help us in writing a LINQ query.&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Lambda Expressions -&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;Part 1&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;In C# 2.0 we used to write anonymous delegate method that helped us in minimizing the code writing. &lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Example: The below code snippet that searches for a Employee based on the Empname field using predicates in C# 2.0&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;color: blue; mso-no-proof: yes;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt; &lt;span style=&quot;color: teal;&quot;&gt;Employee&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; empName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; EmpName&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;get&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (empName != &lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; empName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;set&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;empName = &lt;span style=&quot;color: blue;&quot;&gt;value&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;mso-layout-grid-align: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;Now we will get the employee details from GetAllEmployees() function which is written in Data Access Layer (DAL) Layer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;List &amp;lt;Employee&amp;gt; myEmployees = GetAllEmployees();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;We will use System.Collection.List&amp;lt;T&amp;gt;.FindAll to search for the Employee based on EmpName. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;MSDN has following information on the FindAll method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;Retrieves all the elements that match the conditions defined by the specified predicate.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;For more information : &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/fh1w7y8z.aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/fh1w7y8z.aspx&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;We will now find the employee with the employee name filter.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;List &amp;lt;Employee&amp;gt; employee = myEmployees.FindAll( new Predicate&amp;lt;Employee&amp;gt;(EmpNameFilter));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;//Defination for EmpNameFilter&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;static bool EmpNameFilter(Employee e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;e.EmpName = “Kumar”&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;We will rewrite the above code using C# 2.0 Anonymous method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;List &amp;lt;Employee&amp;gt; employee = myEmployees.FindAll(delegate(Employee e) {return e.EmpName=”Kumar”})&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;We have reduced some coding steps with the help of anonymous method, we still able to reduce the coding steps with the help of &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;Lambda Expression&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;List &amp;lt;Employee&amp;gt; employee = myEmployees.FindAll(e=&amp;gt;e.EmpName==”Kumar”);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;So basically when we have a lambda expression defined then we are inherently using delegates. Its bit difficult for the first time but over a period of time we will feel happy using it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;Accoding to MSDN the following information for Lambda Expression.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;A &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;&lt;i style=&quot;mso-bidi-font-style: normal;&quot;&gt;lambda expression&lt;/i&gt;&lt;/b&gt; is an anonymous function that can contain expressions and statements, and can be used to create delegates or expression tree types.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;All lambda expressions use the lambda operator =&amp;gt;, which is read as &quot;goes to&quot;. The left side of the lambda operator specifies the input parameters (if any) and the right side holds the expression or statement block. The lambda expression x =&amp;gt; x * x is read &quot;x goes to x times x.&quot; This expression can be assigned to a delegate type as follows:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;delegate int &lt;st1:state w:st=&quot;on&quot;&gt;&lt;st1:place w:st=&quot;on&quot;&gt;del&lt;/st1:place&gt;&lt;/st1:state&gt;(int i);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;static void &lt;st1:place w:st=&quot;on&quot;&gt;Main&lt;/st1:place&gt;(string[] args)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;st1:state w:st=&quot;on&quot;&gt;&lt;st1:place w:st=&quot;on&quot;&gt;del&lt;/st1:place&gt;&lt;/st1:state&gt; myDelegate = x =&amp;gt; x * x;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;int j = myDelegate(5); //j = 25&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;mso-no-proof: yes;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;The &lt;span class=&quot;input&quot;&gt;=&amp;gt;&lt;/span&gt; operator has the same precedence as assignment (&lt;span class=&quot;input&quot;&gt;=&lt;/span&gt;) and is right-associative.&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;Lambdas are not allowed on the left side of the &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;is&lt;/b&gt; or &lt;b style=&quot;mso-bidi-font-weight: normal;&quot;&gt;as&lt;/b&gt; operator.&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Hope this article helps you to understand the basic about Lambda Expression.&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Stay tuned for Lambda Expression Part 2. &lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Happy Coding and Leaning.&lt;span style=&quot;mso-bidi-font-size: 10.0pt; mso-no-proof: yes;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techieideas.blogspot.com/feeds/3654798179618458977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techieideas.blogspot.com/2009/12/c-30-new-features-part-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/3654798179618458977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/3654798179618458977'/><link rel='alternate' type='text/html' href='http://techieideas.blogspot.com/2009/12/c-30-new-features-part-2.html' title='C# 3.0 new Features - Part 2'/><author><name>Kumar</name><uri>http://www.blogger.com/profile/10464926383302933718</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5127580816761899505.post-813281747150903156</id><published>2009-12-26T03:19:00.000-08:00</published><updated>2009-12-29T21:55:26.748-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>Static Class for Beginners</title><content type='html'>&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;In general, the members of a class can be accessed by instance of that class when they are in public, but there comes a situation to access or call members of a class without an instance and this can be achieved by declaring them as static.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;How to create a static class and access in our application?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;Step 1:&lt;/b&gt; Create a Static class name as &quot;StaticExample&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Collections.Generic;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Linq;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Text;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;namespace KumarConsoleApplication&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public static class StaticExample&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public static int AddNum(int num1, int num2)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return num1 + num2;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public static int SubNum(int num1, int num2)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return num1 - num2;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;Step 2:&lt;/b&gt; Add reference of the above class in our application.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Collections.Generic;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Linq;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using System.Text;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;using&amp;nbsp;KumarConsoleApplication;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;namespace OurApplication&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;class Program&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;static void Main(string[] args)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine(&quot;Addition &quot; + StaticExample.AddNum(10, 20));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine(&quot;Substraction &quot; + StaticExample.SubNum(30, 10));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.Read();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;div&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;Step 3&lt;/b&gt;: Run the application and see the output in console application&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;The output is :&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Addition&amp;nbsp;30&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Substraction 20&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Features:&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;li&gt;Static classes can not be instantiated.&lt;/li&gt;
&lt;li&gt;Static classes are sealed so they can not be inherited.&lt;/li&gt;
&lt;li&gt;Static class is preceded by keyword static.&lt;/li&gt;
&lt;li&gt;Static constructor of static class called only once.&lt;/li&gt;
&lt;li&gt;Static class can have only static members which means only static members are allowed.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Static class has private constructors.&lt;/li&gt;
&lt;li&gt;Member of the Static class can be accessed by class name itself.&lt;/li&gt;
&lt;li&gt;Static classes can only have static constructor to initialize static members. &amp;nbsp; class has private constructors.&lt;/li&gt;
&lt;/span&gt; &lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Hope this article gave you some idea about static classes&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Happy coding and learning&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://techieideas.blogspot.com/feeds/813281747150903156/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techieideas.blogspot.com/2009/12/static-class-for-beginners.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/813281747150903156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/813281747150903156'/><link rel='alternate' type='text/html' href='http://techieideas.blogspot.com/2009/12/static-class-for-beginners.html' title='Static Class for Beginners'/><author><name>Kumar</name><uri>http://www.blogger.com/profile/10464926383302933718</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5127580816761899505.post-2310654705234951242</id><published>2009-12-23T03:38:00.000-08:00</published><updated>2009-12-29T21:55:26.749-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>C# 3.0 New Features  - Part 1</title><content type='html'>Hi All,&lt;br /&gt;
&lt;br /&gt;
Below are the new features of C# 3.0&lt;br /&gt;
&lt;br /&gt;
1. &lt;b&gt;Implicitly Typed Local Variables&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
C# 3.0 introduces a new keyword called &quot;var&quot;. Var allows you to declare a new variable, whose type is implicitly inferred from the expression used to initialize the variable.This is a new and handy keyword that&#39;ll save you some typing. Example below:&lt;br /&gt;
&lt;br /&gt;
// C# 2.0&lt;br /&gt;
&lt;br /&gt;
int i = 10;&lt;br /&gt;
&lt;br /&gt;
string str = &quot;Hello Techies&quot;;&lt;br /&gt;
&lt;br /&gt;
// New C# 3.0 var type&lt;br /&gt;
&lt;br /&gt;
var i = 5;&lt;br /&gt;
&lt;br /&gt;
var str = &quot;Hello Techies&quot;;&lt;br /&gt;
&lt;br /&gt;
The var keyword is NOT a completely new type, instead the compiler just takes a look at the right-hand side of the expression. If the right-hand side is an int, for example, the compiler will &quot;replace&quot; the var keyword with int. This means that the following contruction will NOT work:&lt;br /&gt;
&lt;br /&gt;
// Will not work, &#39;cause the right-hand side of the var is unknown&lt;br /&gt;
var b;&lt;br /&gt;
b = 1556;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Some Restriction&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
We cannot do the increment and decrement operation like i++ or ++i&lt;br /&gt;
We cannot declare the NULL value to the var variable&lt;br /&gt;
We cannot initialize the multiple var variables like others. Int &amp;nbsp;I, j, k&lt;br /&gt;
2.&lt;b&gt;Anonymous Types&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
C# 3.0 gives you the flexibility to create an instance of a class without having to write code for the class beforehand.&lt;br /&gt;
&lt;br /&gt;
new { Name = &quot;Kumar&quot;, Gender = &quot;Male&quot;, Age = 25 };&lt;br /&gt;
&lt;br /&gt;
In the background, the C# compiler would create a class that looks as follows:&lt;br /&gt;
&lt;br /&gt;
class __Anonymous1&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; private string _Name = &quot;Kumar&quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; private string _Gender = &quot;Male&quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; private int _Age &amp;nbsp; = 20;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; public string Name {get { return _Name; } set { _Name = value; }}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; public string Gender {get { return _Gender; } set { _Gender = value; }}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; public int Age {get { return _Age; } set { _Age = value; }}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Now the user have a class, but the user still need something to hold an instance of the above class. This is where the &quot;var&quot; keyword comes in handy; it lets you hold a statically typed instance of the above instance of the anonymous type. Here is a rather simple and easy use of an anonymous type:&lt;br /&gt;
&lt;br /&gt;
var employee = new { Name = &quot;Kumar&quot;, Gender = &quot;Male&quot;, Age = 25 };&lt;br /&gt;
&lt;br /&gt;
3.&lt;b&gt;Auto Implemented Property&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
This property plays significant role to set and get the values. In the previous versions we used to set the values to the temporarily local variable. Now it has been reduced in the C# 3.0 version. Because, .Net compiler will handle it implicitly&lt;br /&gt;
&lt;br /&gt;
Let&#39;s see the new version, Auto implemented property.&lt;br /&gt;
&lt;br /&gt;
[Access-modifier] data type [Name of the property]&lt;br /&gt;
{&lt;br /&gt;
get;&lt;br /&gt;
set;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
For example we are going to create one property for Employee.&lt;br /&gt;
&lt;br /&gt;
public string employeeID {get; set ;}&lt;br /&gt;
public string employeeName {get; set ;}&lt;br /&gt;
public int age {get; set ;}&lt;br /&gt;
&lt;br /&gt;
In previous version we have done like this.&lt;br /&gt;
&lt;br /&gt;
private string _employeeName;&lt;br /&gt;
public string employeeName&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;get&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return _employeeName;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;set&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_employeeName = value;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Here in C# 3.0, it became auto implemented property, that means in the runtime, the .net compiler will assign the values to temp variable.&lt;br /&gt;
&lt;br /&gt;
4.&lt;b&gt;Object initializers&lt;/b&gt;&lt;br /&gt;
In C# 3.0 a new way to initialize objects. Example below:&lt;br /&gt;
&lt;br /&gt;
// The old way&lt;br /&gt;
Employee emp = new Employee(); // Create object&lt;br /&gt;
emp.Name = &quot;Kumar&quot;; // Initialize property Name&lt;br /&gt;
emp.Gender = &quot;Male&quot;; // Initialize property Gender&lt;br /&gt;
emp.Age = 25; // Initialize property Age&lt;br /&gt;
&lt;br /&gt;
// New way&lt;br /&gt;
Employee &amp;nbsp;emp = new Employee { Name = &quot;Kumar&quot;, Gender = &quot;Male&quot;, Age = 25 };&lt;br /&gt;
&lt;br /&gt;
This will also save some lines of code&lt;br /&gt;
&lt;br /&gt;
Hope this article helps you.&lt;br /&gt;
&lt;br /&gt;
Happy Learning and Coding&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Kumar&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://techieideas.blogspot.com/feeds/2310654705234951242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techieideas.blogspot.com/2009/12/c-30-new-features-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/2310654705234951242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/2310654705234951242'/><link rel='alternate' type='text/html' href='http://techieideas.blogspot.com/2009/12/c-30-new-features-part-1.html' title='C# 3.0 New Features  - Part 1'/><author><name>Kumar</name><uri>http://www.blogger.com/profile/10464926383302933718</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5127580816761899505.post-7792870659784671005</id><published>2009-11-26T05:53:00.000-08:00</published><updated>2009-11-26T05:58:50.781-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>SQL Database Offline / Online</title><content type='html'>If the user wants to make the database offline or online below are the commands.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;First Method:&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
To make database offline use the below query&lt;br /&gt;
&lt;b&gt;ALTER DATABASE [Database name] SET OFFLINE&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
To make database online use the below query&lt;br /&gt;
&lt;b&gt;ALTER DATABASE [Database name] SET ONLINE&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Second Method:&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
User can also right click on the Database and select &lt;b&gt;Tasks-&gt;Take Offline&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
select &lt;b&gt;Tasks-&gt;Brink online&lt;/b&gt; for making Database to Online</content><link rel='replies' type='application/atom+xml' href='http://techieideas.blogspot.com/feeds/7792870659784671005/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techieideas.blogspot.com/2009/11/sql-database-offline-online.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/7792870659784671005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/7792870659784671005'/><link rel='alternate' type='text/html' href='http://techieideas.blogspot.com/2009/11/sql-database-offline-online.html' title='SQL Database Offline / Online'/><author><name>Kumar</name><uri>http://www.blogger.com/profile/10464926383302933718</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5127580816761899505.post-7110456063174749599</id><published>2009-11-25T22:41:00.000-08:00</published><updated>2009-11-25T22:50:13.536-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".net"/><title type='text'>Turn off Session State when not required</title><content type='html'>Asp.net Session state is ON by default. Memory is lost even if we don&#39;t use this session state.&lt;br /&gt;
To improve the performance we need to turn off the session state when we are not in use.&lt;br /&gt;
&lt;br /&gt;
Below are the different ways to turn off the session state.&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;If you don&#39;t want the session for your entire application then,turn off the session state in web.config file.&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 13px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;system.web&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;sessionState&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;mode&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Off&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;sessionState&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: small;&quot;&gt;&lt;span style=&quot;font-size: 13px;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Times New Roman&#39;; font-size: medium;&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;If session is not required for few pages , then turn off the session state in page level.&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 13px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;system.web&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;pages&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;enableSessionState&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;false&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: small;&quot;&gt;&lt;span style=&quot;font-size: 13px;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;If you want to enable the session state for&amp;nbsp;particular&amp;nbsp;page&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;&amp;lt;%&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;@ &lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Page&lt;/span&gt; ... &lt;span style=&quot;color: red;&quot;&gt;EnableSessionState&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;true&quot;&lt;/span&gt; &lt;span style=&quot;background-color: yellow;&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://techieideas.blogspot.com/feeds/7110456063174749599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techieideas.blogspot.com/2009/11/turn-off-session-state-when-not.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/7110456063174749599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/7110456063174749599'/><link rel='alternate' type='text/html' href='http://techieideas.blogspot.com/2009/11/turn-off-session-state-when-not.html' title='Turn off Session State when not required'/><author><name>Kumar</name><uri>http://www.blogger.com/profile/10464926383302933718</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5127580816761899505.post-1488590335192850636</id><published>2009-10-12T05:56:00.000-07:00</published><updated>2009-10-12T06:02:21.031-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net Questions and answers"/><title type='text'>What is &quot;Microsoft Intermediate Language&quot; (MSIL)?</title><content type='html'>MSIL stands for Microsoft Intermediate Language. It can be called as Intermediate Language (IL) or Common Intermediate Language (CIL). During the compile time , the compiler convert the source code into Microsoft Intermediate Language (MSIL) .Microsoft Intermediate Language (MSIL) is a CPU-independent set of instructions that can be efficiently converted to the native code. During the runtime the Common Language Runtime (CLR)&#39;s Just In Time (JIT) compiler converts the Microsoft Intermediate Language (MSIL) code into native code to the Operating systems.&lt;br /&gt;
&lt;br /&gt;
When a compiler produces Microsoft Intermediate Language (MSIL), it also produces Metadata. The Microsoft Intermediate Language (MSIL) and Metadata are contained in a portable executable (PE) file . Microsoft Intermediate Language (MSIL) includes instructions for loading, storing, initializing, and calling methods on objects, as well as instructions for arithmetic and logical operations, control flow, direct memory access, exception handling, and other operations.</content><link rel='replies' type='application/atom+xml' href='http://techieideas.blogspot.com/feeds/1488590335192850636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techieideas.blogspot.com/2009/10/what-is-microsoft-intermediate-language.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/1488590335192850636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/1488590335192850636'/><link rel='alternate' type='text/html' href='http://techieideas.blogspot.com/2009/10/what-is-microsoft-intermediate-language.html' title='What is &quot;Microsoft Intermediate Language&quot; (MSIL)?'/><author><name>Kumar</name><uri>http://www.blogger.com/profile/10464926383302933718</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5127580816761899505.post-1862369671205664046</id><published>2009-10-12T03:45:00.000-07:00</published><updated>2009-10-12T06:02:09.154-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net Questions and answers"/><title type='text'>What do you mean by Web Service?</title><content type='html'>&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;The term Web services describes a standardized way of integrating Web-based applications using the XML, SOAP, WSDL and UDDI open standards over an Internet protocol backbone. &lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;XML is used to tag the data&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;SOAP is used to transfer the data&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;WSDL is used for describing the services available&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;UDDI is used for listing what services are available&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;Used primarily as a means for businesses to communicate with each other and with clients, Web services allow organizations to communicate data without intimate knowledge of each other&#39;s IT systems behind the firewall.&amp;nbsp;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://techieideas.blogspot.com/feeds/1862369671205664046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techieideas.blogspot.com/2009/10/what-do-you-mean-by-web-service.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/1862369671205664046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/1862369671205664046'/><link rel='alternate' type='text/html' href='http://techieideas.blogspot.com/2009/10/what-do-you-mean-by-web-service.html' title='What do you mean by Web Service?'/><author><name>Kumar</name><uri>http://www.blogger.com/profile/10464926383302933718</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5127580816761899505.post-2765807743756614281</id><published>2009-10-12T01:56:00.000-07:00</published><updated>2009-10-12T01:58:59.751-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asp.net Questions and answers"/><title type='text'>What is Fragment Caching in ASP.NET?</title><content type='html'>&lt;div style=&quot;text-align: left;&quot;&gt;Fragment Caching in asp.net&lt;br /&gt;
&lt;/div&gt;&lt;ul&gt;&lt;ul&gt;&lt;li&gt;Fragment caching refers to the caching of individual user controls within a Web Form.&lt;/li&gt;
&lt;li&gt;Each user control can have independent cache durations and implementations of how the caching behavior is to be applied.&lt;/li&gt;
&lt;li style=&quot;text-align: left;&quot;&gt;Fragment caching is useful when you need to cache only a subset of a page.&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;It is good to use in navigation bar,headers and footers.</content><link rel='replies' type='application/atom+xml' href='http://techieideas.blogspot.com/feeds/2765807743756614281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techieideas.blogspot.com/2009/10/what-is-fragment-caching-in-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/2765807743756614281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/2765807743756614281'/><link rel='alternate' type='text/html' href='http://techieideas.blogspot.com/2009/10/what-is-fragment-caching-in-aspnet.html' title='What is Fragment Caching in ASP.NET?'/><author><name>Kumar</name><uri>http://www.blogger.com/profile/10464926383302933718</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5127580816761899505.post-385877850558724010</id><published>2009-09-28T05:41:00.000-07:00</published><updated>2009-12-29T21:55:41.800-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".net"/><title type='text'>Retain Web Browser Scroll Position After a Postback</title><content type='html'>Following are the ways where the user can maintain the scroll position after a postback.&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;In the page declaration, add &lt;i&gt;&lt;b&gt;&amp;lt;%@ Page MaintainScrollPositionOnPostback=&quot;true&quot; %&amp;gt;&lt;/b&gt;&lt;/i&gt;&amp;nbsp;This will maintain the scroll position of that particular page only.&lt;/li&gt;
&lt;li&gt;The user can even set via code behind also by including&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;b&gt;&lt;i&gt;&amp;nbsp;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-style: normal; font-weight: normal;&quot;&gt;&lt;i&gt;&lt;b&gt;System.Web.UI.Page.MaintainScrollPositionOnPostBack = true;&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;The above two will maintain the scroll position for that page only. In order to&amp;nbsp;maintain the scroll positions for the entire web site pages user has to&amp;nbsp;add the Boolean attribute &lt;b&gt;&lt;i&gt;maintainScrollPositionOnPostBack=&quot;true&quot;&lt;/i&gt;&lt;/b&gt;&amp;nbsp;&amp;nbsp;in &lt;tt&gt;&lt;i&gt;&lt;b&gt;Web.config&lt;/b&gt;&lt;/i&gt; file&lt;/tt&gt;&amp;nbsp;of &lt;b&gt;&lt;i&gt;&amp;lt;pages&amp;gt;&lt;/i&gt;&lt;/b&gt; &amp;nbsp;section.&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;&lt;div&gt;&amp;lt;pages &amp;nbsp; &lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; buffer=&quot;[True|False]&quot;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; enableEventValidation=&quot;[True|False]&quot;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; enableSessionState=&quot;[True|False|ReadOnly]&quot;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; enableViewState=&quot;[True|False]&quot;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; enableViewStateMac=&quot;[True|False]&quot;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; smartNavigation=&quot;[True|False]&quot;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; autoEventWireup=&quot;[True|False]&quot;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; pageBaseType=&quot;typename, assembly&quot;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; userControlBaseType=&quot;typename&quot;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; validateRequest=&quot;[True|False]&quot;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; masterPageFile=&quot;file path&quot;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; theme=&quot;string&quot;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; styleSheetTheme=&quot;string&quot;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; maxPageStateFieldLength=&quot;number&quot;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; compilationMode=&quot;[Always|Auto|Never]&quot;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; pageParserFilterType=&quot;string&quot;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; viewStateEncryptionMode=&quot;[Always|Auto|Never]&quot;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;i&gt; maintainScrollPositionOnPostBack=&quot;[True|False]&quot;&amp;nbsp;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; asyncTimeout=&quot;number&quot;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;lt;controls&amp;gt;...&amp;lt;/controls&amp;gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;lt;namespaces&amp;gt;...&amp;lt;/namespaces&amp;gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; &amp;lt;tagMapping&amp;gt;...&amp;lt;/tagMapping&amp;gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;lt;/pages&amp;gt;&lt;br /&gt;
&lt;/div&gt;&lt;ol&gt;&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://techieideas.blogspot.com/feeds/385877850558724010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techieideas.blogspot.com/2009/09/retain-web-browser-scroll-position.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/385877850558724010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/385877850558724010'/><link rel='alternate' type='text/html' href='http://techieideas.blogspot.com/2009/09/retain-web-browser-scroll-position.html' title='Retain Web Browser Scroll Position After a Postback'/><author><name>Kumar</name><uri>http://www.blogger.com/profile/10464926383302933718</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5127580816761899505.post-5948002610913400914</id><published>2009-09-28T05:29:00.000-07:00</published><updated>2009-09-28T05:29:17.432-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".net"/><title type='text'>Open a URL in Internet Explorer using Process.Start</title><content type='html'>You can use &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx&quot;&gt;System.Diagnostics.Process.Start&lt;/a&gt; to launch Internet Explorer and open a web page.&lt;br /&gt;
&lt;br /&gt;
The below code will open the specified URL in the default browser window.&lt;br /&gt;
&lt;br /&gt;
string strWebLink = &quot;www.techieideas.blogspot.com&quot;;&lt;br /&gt;
Process.Start(&quot;iexplore.exe&quot;, strWebLink);&lt;br /&gt;
&lt;br /&gt;
The below code will open the specified URL in a new browser window.&lt;br /&gt;
&lt;br /&gt;
string strWebLink = &quot;www.techieideas.blogspot.com&quot;;&lt;br /&gt;
Process.Start(@&quot;C:\Program Files\Internet Explorer\iexplore.exe&quot;, &quot;-new &quot; + strWebLink);</content><link rel='replies' type='application/atom+xml' href='http://techieideas.blogspot.com/feeds/5948002610913400914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techieideas.blogspot.com/2009/09/open-url-in-internet-explorer-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/5948002610913400914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/5948002610913400914'/><link rel='alternate' type='text/html' href='http://techieideas.blogspot.com/2009/09/open-url-in-internet-explorer-using.html' title='Open a URL in Internet Explorer using Process.Start'/><author><name>Kumar</name><uri>http://www.blogger.com/profile/10464926383302933718</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5127580816761899505.post-8709871037529548990</id><published>2009-09-28T05:21:00.000-07:00</published><updated>2009-09-28T05:22:29.601-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".net"/><title type='text'>Sending eMail using SmtpClient class</title><content type='html'>This sample code demonstrates how to send an email using the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspx&quot; target=&quot;_blank&quot;&gt;System.Net.Mail.SmtpClient&lt;/a&gt; class.&lt;br /&gt;
&lt;br /&gt;
private bool sendMail(string strToAddress, string strFromAddress, string strSubject, string strBody)&lt;br /&gt;
{&lt;br /&gt;
// new instance of MailMessage&lt;br /&gt;
MailMessage mailMessage = new MailMessage();&lt;br /&gt;
&lt;br /&gt;
// Sender Address&lt;br /&gt;
mailMessage.From = new MailAddress(strFromAddress);&lt;br /&gt;
&lt;br /&gt;
// Recepient Address&lt;br /&gt;
mailMessage.To.Add(new MailAddress(strToAddress));&lt;br /&gt;
&lt;br /&gt;
// Subject &lt;br /&gt;
mailMessage.Subject = strSubject;&lt;br /&gt;
&lt;br /&gt;
// Body&lt;br /&gt;
mailMessage.Body = strBody;&lt;br /&gt;
&lt;br /&gt;
// format of mail message&lt;br /&gt;
mailMessage.IsBodyHtml = true;&lt;br /&gt;
&lt;br /&gt;
// new instance of Smtpclient&lt;br /&gt;
SmtpClient mailSmtpClient = new SmtpClient(&quot;smtpServer&quot;);&lt;br /&gt;
&lt;br /&gt;
// mail sent&lt;br /&gt;
mailSmtpClient.Send(mailMessage);&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://techieideas.blogspot.com/feeds/8709871037529548990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://techieideas.blogspot.com/2009/09/sending-email-using-smtpclient-class.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/8709871037529548990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5127580816761899505/posts/default/8709871037529548990'/><link rel='alternate' type='text/html' href='http://techieideas.blogspot.com/2009/09/sending-email-using-smtpclient-class.html' title='Sending eMail using SmtpClient class'/><author><name>Kumar</name><uri>http://www.blogger.com/profile/10464926383302933718</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>