<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://dotnetslackers.com/Community/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>KaushaL.NET</title><link>http://dotnetslackers.com/Community/blogs/kaushalparik/default.aspx</link><description>&lt;table cellpadding="0" cellspacing="0" style="width:100%;"&gt;
    &lt;tr&gt;
        &lt;td align="left" style="text-align:left;"&gt;
            &lt;p id="tagline" style="text-align:left;"&gt;
                &lt;img src="http://dotnetslackers.com/Community/blogs/kaushalparik/avatar_0e48be1b7ad0_128.png" alt="" /&gt;
            &lt;/p&gt;
        &lt;/td&gt;
        &lt;td align="right" style="text-align:right;float:right;"&gt;
            { a .net developer&amp;#39;s blog; }
            &lt;br /&gt;
            &lt;br /&gt;
            &lt;a target="_blank" href="http://twitter.com/kaushalparik27" style="display:block;text-align:left;padding:3px 3px 3px 3px;"&gt;Follow me on Twitter&lt;/a&gt; &lt;a target="_blank" href="http://weblogs.asp.net/kaushal/" style="display:block;text-align:left;padding:3px 3px 3px 3px;"&gt;Me on Weblogs&lt;/a&gt; &lt;a target="_blank" href="http://www.microsoft.com/india/mvp/indiamvp.aspx#Kaushal%20Parik" style="display:block;text-align:left;padding:3px 3px 3px 3px;"&gt;MVP Profile&lt;/a&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 SP1 (Build: 30415.43)</generator><item><title>Awarded with Microsoft Community Contributor [MCC] Award 2011</title><link>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2011/04/28/awarded-with-microsoft-community-contributor-mcc-award-2011.aspx</link><pubDate>Thu, 28 Apr 2011 12:39:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:37110</guid><dc:creator>kaushalparik</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/kaushalparik/rsscomments.aspx?PostID=37110</wfw:commentRss><comments>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2011/04/28/awarded-with-microsoft-community-contributor-mcc-award-2011.aspx#comments</comments><description>&lt;p&gt;Good news readers! I have been awarded with Microsoft Community Contributor [MCC] Award 2011 by Microsoft. Its truly said that credit should be given where its due. &lt;/p&gt;
&lt;p&gt;Long live the community! :)&lt;/p&gt;
&lt;p&gt;&lt;img src="http://dotnetslackers.com/Community/blogs/kaushalparik/MCC11_Logo_Horizontal_Full-color.jpg" alt="" /&gt;&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=37110" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushalparik27/default.aspx">kaushalparik27</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushal.net/default.aspx">kaushal.net</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Microsoft+Community+Contributor+Award/default.aspx">Microsoft Community Contributor Award</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/MCC/default.aspx">MCC</category></item><item><title>Start/Stop Window Service from ASP.NET page</title><link>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2011/03/02/start-stop-window-service-from-asp-net-page.aspx</link><pubDate>Wed, 02 Mar 2011 02:39:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:37054</guid><dc:creator>kaushalparik</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/kaushalparik/rsscomments.aspx?PostID=37054</wfw:commentRss><comments>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2011/03/02/start-stop-window-service-from-asp-net-page.aspx#comments</comments><description>&lt;p&gt;Last week, I needed to complete one task on which I am going to blog 
about in this entry. The task is &amp;quot;Create a control panel like webpage to
 control (Start/Stop) Window Services which are part of my solution 
installed on computer where the main application is hosted&amp;quot;. &lt;br /&gt;&lt;br /&gt;Here are the important points to accomplish:&lt;br /&gt;[1] You need to add &lt;a href="http://msdn.microsoft.com/en-us/library/system.serviceprocess.aspx" target="_blank"&gt;System.ServiceProcess&lt;/a&gt; reference in your application. This namespace holds &lt;a href="http://msdn.microsoft.com/en-us/library/system.serviceprocess.servicecontroller.aspx" target="_blank"&gt;ServiceController Class&lt;/a&gt; to access the window service.&lt;br /&gt;&lt;br /&gt;[2] You need to check the status of the window services before you explicitly start or stop it.&lt;br /&gt;&lt;br /&gt;[3]
 By default, IIS application runs under ASP.NET account which doesn&amp;#39;t 
have access rights permission to window service. So, Very Important part
 of the solution is: &lt;a href="http://support.microsoft.com/kb/306158" target="_blank"&gt;Impersonation&lt;/a&gt;.
 You need to impersonate the application/part of the code with the User 
Credentials which is having proper rights and permission to access the 
window service. &lt;br /&gt;&lt;br /&gt;If you try to access window service it will generate &amp;quot;access denied&amp;quot; &lt;a href="http://www.dotnetmonster.com/Uwe/Forum.aspx/asp-net/23826/ASPX-ACCESS-denied-when-start-stop-windows-services" target="_blank"&gt;error&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The alternatives are: You can either impersonate whole application by adding Identity tag in web.cofig as:&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;identity impersonate=&amp;quot;true&amp;quot; userName=&amp;quot;&amp;quot; password=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;&lt;br /&gt;This
 tag will be under System.Web section. the &amp;quot;userName&amp;quot; and &amp;quot;password&amp;quot; 
will be the credentials of the user which is having rights to access the
 window service. But, this would not be a wise and good solution; 
because you may not impersonate whole website like this just to have 
access window service (which is going to be a small part of code).&lt;br /&gt;&lt;br /&gt;Second
 alternative is: Only impersonate part of code where you need to access 
the window service to start or stop it. I opted this one. But, to be 
fair; I am really unaware of the code part for impersonation. So, I just
 googled it and injected the code in my solution in a separate class 
file named as &amp;quot;Impersonate&amp;quot; with required static methods. In Impersonate
 class; impersonateValidUser() is the method to impersonate a part of 
code and undoImpersonation() is the method to undo the impersonation. 
Below is one example:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="http://weblogs.asp.net/blogs/kaushal/BlogFiles/2-28-2011%2010-33-14%20PM.png" title="Start/Stop Window Service from ASP.NET page" alt="Start/Stop Window Service from ASP.NET page" height="226" width="700" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;You
 need to provide domain name (which is &amp;quot;.&amp;quot; if you are working on your 
home computer), username and password of appropriate user to 
impersonate.&lt;br /&gt;&lt;br /&gt;[4] Here, it is very important to note that: You 
need to have to store the Access Credentials (username and password) 
which you are going to user for impersonation; to some secured and 
encrypted format. I have used Machinekey Encryption to store the value 
encrypted value inside database.&lt;br /&gt;&lt;br /&gt;[5] So now; The real part is to 
start or stop a window service. You are almost done; because 
ServiceController class has simple Start() and Stop() methods to start 
or stop a window service. A ServiceController class has parametrized 
constructor that takes name of the service as parameter.&lt;br /&gt;&lt;br /&gt;Code to Start the window service:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://weblogs.asp.net/blogs/kaushal/BlogFiles/3-1-2011%201-10-44%20AM.png" title="Start/Stop Window Service from ASP.NET page" alt="Start/Stop Window Service from ASP.NET page" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Code to Stop the window service:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://weblogs.asp.net/blogs/kaushal/BlogFiles/3-1-2011%201-12-24%20AM.png" title="Start/Stop Window Service from ASP.NET page" alt="Start/Stop Window Service from ASP.NET page" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Isn&amp;#39;t that too easy! ServiceController made it easy :) I have attached a working example with this post &lt;a href="http://weblogs.asp.net/blogs/kaushal/BlogFiles/WindowServiceHandler.zip"&gt;here&lt;/a&gt;
 to start/stop &amp;quot;SQLBrowser&amp;quot; service where you need to provide proper 
credentials who have permission to access to window service. &lt;/p&gt;
&lt;p&gt;&lt;img src="http://weblogs.asp.net/blogs/kaushal/BlogFiles/2-28-2011%2010-25-53%20PM.png" title="Start/Stop Window Service from ASP.NET page" alt="Start/Stop Window Service from ASP.NET page" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;hope it would helps./.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=37054" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/.NET/default.aspx">.NET</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/KaushalParik/default.aspx">KaushalParik</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushalparik27/default.aspx">kaushalparik27</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushal.net/default.aspx">kaushal.net</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/System.ServiceProcess/default.aspx">System.ServiceProcess</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/ServiceController/default.aspx">ServiceController</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/start_2F00_stop+window+service+from+asp.net/default.aspx">start/stop window service from asp.net</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Window+Services/default.aspx">Window Services</category></item><item><title>Linq To SQL: Behaviour for table field which is NotNull and having Default value or binding</title><link>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2011/03/01/linq-to-sql-behaviour-for-table-field-which-is-notnull-and-having-default-value-or-binding.aspx</link><pubDate>Tue, 01 Mar 2011 06:35:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:37053</guid><dc:creator>kaushalparik</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/kaushalparik/rsscomments.aspx?PostID=37053</wfw:commentRss><comments>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2011/03/01/linq-to-sql-behaviour-for-table-field-which-is-notnull-and-having-default-value-or-binding.aspx#comments</comments><description>&lt;p&gt;I found this something interesting while wandering over community 
which I would like to share. The post is whole about: DBML is not 
considering the table field&amp;#39;s &amp;quot;Default value or Binding&amp;quot; setting which 
is a NotNull. I mean the field which can not be null but having default 
value set needs to be set IsDbGenerated = true in DBML file explicitly.&lt;br /&gt;&lt;br /&gt;Consider this situation: There is a simple tblEmployee table with below structure:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://weblogs.asp.net/blogs/kaushal/BlogFiles/2-26-2011%2010-35-51%20PM.png" title="tblEmployee Image" alt="tblEmployee Image" height="334" width="651" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The
 fields are simple. EmployeeID is a Primary Key with Identity 
Specification = True with Identity Seed = 1 to autogenerate numeric 
value for this field. EmployeeName and their EmailAddress to store in 
rest of 2 fields. And the last one is &amp;quot;DateAdded&amp;quot; with DateTime datatype
 which doesn&amp;#39;t allow NULL but having Default Value/Binding with 
&amp;quot;GetDate()&amp;quot;. That means if we don&amp;#39;t pass any value to this field then 
SQL will insert current date in &amp;quot;DateAdded&amp;quot; field.&lt;br /&gt;&lt;br /&gt;So, I start 
with a new website, add a DBML file and dropped the said table to 
generate LINQ To SQL context class. Finally, I write a simple code 
snippet to insert data into the tblEmployee table; BUT, I am not passing
 any value to &amp;quot;DateAdded&amp;quot; field. Because I am considering SQL Server&amp;#39;s 
&amp;quot;Default Value or Binding (GetDate())&amp;quot; setting to this field and 
understand that SQL will insert current date to this field.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using (TestDatabaseDataContext context = new TestDatabaseDataContext())&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tblEmployee tblEmpObjet = new tblEmployee();&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; tblEmpObjet.EmployeeName = &amp;quot;KaushaL&amp;quot;;&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; tblEmpObjet.EmployeeEmailAddress = &amp;quot;kaushal@emaildomain.com&amp;quot;;&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; context.tblEmployees.InsertOnSubmit(tblEmpObjet);&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; context.SubmitChanges();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;Here comes the twist when application give me below error: &lt;/p&gt;
&lt;p&gt;&lt;img src="http://weblogs.asp.net/blogs/kaushal/BlogFiles/2-26-2011%2010-45-13%20PM.png" title="Error Image" alt="Error Image" height="269" width="703" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This
 is something not expecting! From the error it clearly depicts that LINQ
 is passing NULL value to &amp;quot;DateAdded&amp;quot; Field while according to my 
understanding it should respect Sql Server&amp;#39;s &amp;quot;Default value or Binding&amp;quot; 
setting for this field. A bit googling and I found very interesting 
related to this problem.&lt;br /&gt;&lt;br /&gt;When we set Primary Key to any field 
with &amp;quot;Identity Specification&amp;quot; Property set to true; DBML set one 
important property &amp;quot;IsDbGenerated=true&amp;quot; for this field.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://weblogs.asp.net/blogs/kaushal/BlogFiles/2-26-2011%2010-49-34%20PM.png" title="IsDbGenerated=True Setting in Dbml.Designer.cs file" alt="IsDbGenerated=True Setting in Dbml.Designer.cs file" height="219" width="424" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;BUT,
 when we set &amp;quot;Default Value or Biding&amp;quot; property for some field; we need 
to explicitly tell the DBML/LINQ to let it know that this field is 
having default binding at DB side that needs to be respected if I don&amp;#39;t 
pass any value. So, the solution is: You need to explicitly set 
&amp;quot;IsDbGenerated=true&amp;quot; for such field to tell the LINQ that the field is 
having default value or binding at Sql Server side so, please don&amp;#39;t 
worry if i don&amp;#39;t pass any value for it.&lt;br /&gt;&lt;br /&gt;You can select the field 
and set this property from property window in DBML Designer file or 
write the property in DBML.Designer.cs file directly.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://weblogs.asp.net/blogs/kaushal/BlogFiles/2-26-2011%2010-50-35%20PM.png" title="Field with Default Value or Binding needs to be set IsDbGenerated = true in DBML file" alt="Field with Default Value or Binding needs to be set IsDbGenerated = true in DBML file" height="266" width="511" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I have attached a working example with required table script with this post &lt;a href="http://weblogs.asp.net/blogs/kaushal/BlogFiles/DBMLTest.zip"&gt;here&lt;/a&gt;. I hope this would be helpful for someone hunting for the same. Happy Discovery!&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=37053" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/.NET/default.aspx">.NET</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/LinQ/default.aspx">LinQ</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Linq+To+SQL/default.aspx">Linq To SQL</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/IsDbGenerated/default.aspx">IsDbGenerated</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Auto+Generated+Value/default.aspx">Auto Generated Value</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/DBML/default.aspx">DBML</category></item><item><title>Executing server validators first before OnClientClick Javascript confirm/alert</title><link>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2011/02/28/executing-server-validators-first-before-onclientclick-javascript-confirm-alert.aspx</link><pubDate>Mon, 28 Feb 2011 09:18:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:37052</guid><dc:creator>kaushalparik</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/kaushalparik/rsscomments.aspx?PostID=37052</wfw:commentRss><comments>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2011/02/28/executing-server-validators-first-before-onclientclick-javascript-confirm-alert.aspx#comments</comments><description>&lt;p&gt;I got to answer a simple question over community forums. &lt;br /&gt;&lt;br /&gt;Consider
 this: Suppose you are developing a webpage with few input controls and a
 submit button. You have placed some server validator controls like 
RequiredFieldValidator to validate the inputs entered by the user. Once 
user fill-in all the details and try to submit the page via button click
 you want to alert/confirm the submission like &amp;quot;Are you sure to modify 
above details?&amp;quot;. You will consider to use javascript on click of the 
button.&lt;br /&gt;&lt;br /&gt;Everything seems simple and you are almost done. BUT, 
when you run the page; you will see that Javascript alert/confirm box is
 executing first before server validators try to validate the input 
controls! Well, this is expected behaviour. BUT, this is not you want. 
Then? &lt;br /&gt;&lt;br /&gt;The simple answer is: Call Page_ClientValidate() in 
javascript where you are alerting the submission. Below is the 
javascript example:&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;script type=&amp;quot;text/javascript&amp;quot; language=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function ValidateAllValidationGroups() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (Page_ClientValidate()) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return confirm(&amp;quot;Are you sure to modify above details?&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;Page_ClientValidate()
 function tests for all server validators and return bool value depends 
on whether the page meets defined validation criteria or not. In above 
example, confirm alert will only popup up if Page_ClientValidate() 
returns true (if all validations satisfy). You can also specify 
ValidationGroup inside this function as 
Page_ClientValidate(&amp;#39;ValidationGroup1&amp;#39;) to only validate a specific 
group of validation in your page.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function ValidateSpecificValidationGroup() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (Page_ClientValidate(&amp;#39;ValidationGroup1&amp;#39;)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return confirm(&amp;quot;Are you sure to modify above details?&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;I have attached a sample example with this post &lt;a href="http://weblogs.asp.net/blogs/kaushal/BlogFiles/Validation.zip"&gt;here&lt;/a&gt; demonstrating both above cases. Hope it helps./.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=37052" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/.NET/default.aspx">.NET</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/RequiredFieldValidator/default.aspx">RequiredFieldValidator</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/OnClientClick/default.aspx">OnClientClick</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Page_5F00_ClientValidate_28002900_/default.aspx">Page_ClientValidate()</category></item><item><title>User is trying to leave! Set at-least confirm alert on browser(tab) close event!!</title><link>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2011/02/27/user-is-trying-to-leave-set-at-least-confirm-alert-on-browser-tab-close-event.aspx</link><pubDate>Sun, 27 Feb 2011 18:25:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:37050</guid><dc:creator>kaushalparik</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/kaushalparik/rsscomments.aspx?PostID=37050</wfw:commentRss><comments>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2011/02/27/user-is-trying-to-leave-set-at-least-confirm-alert-on-browser-tab-close-event.aspx#comments</comments><description>&lt;p&gt;This is something that might be annoying or irritating for end user. 
Obviously, It&amp;#39;s impossible to prevent end user from closing the/any 
browser. Just think of this if it becomes possible!!!. That will be a 
horrible web world where everytime you will be attacked by sites and 
they will not allow to close your browser until you confirm your 
shopping cart and do the payment. LOL:) You need to open the task 
manager and might have to kill the running browser exe processes.&lt;br /&gt;&lt;br /&gt;Anyways;
 Jokes apart, but I have one situation where I need to alert/confirm 
from the user in any anyway when they try to close the browser or change
 the url. &lt;br /&gt;&lt;br /&gt;Think of this: You are creating a single page intranet
 asp.net application where your employee can enter/select their 
TDS/Investment Declarations and you wish to at-least ALERT/CONFIRM them 
if they are attempting to:&lt;br /&gt;[1] Close the Browser&lt;br /&gt;[2] Close the Browser Tab&lt;br /&gt;[3] Attempt to go some other site by Changing the url&lt;br /&gt;without completing/freezing their declaration.&lt;br /&gt;&lt;br /&gt;So,
 Finally requirement is clear. I need to alert/confirm the user what he 
is going to do on above bulleted events. I am going to use 
window.onbeforeunload event to set the javascript confirm alert box to 
appear.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;script language=&amp;quot;JavaScript&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.onbeforeunload = confirmExit;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function confirmExit() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
 return &amp;quot;You are about to exit the system before freezing your 
declaration! If you leave now and never return to freeze your 
declaration; then they will not go into effect and you may lose tax 
deduction, Are you sure you want to leave now?&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;See!
 you are halfway done!. So, every time browser unloads the page, above 
confirm alert causes to appear on front of user like below:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://weblogs.asp.net/blogs/kaushal/BlogFiles/confirm-alert.png" title="User is trying to leave! Set confirm alert on browser(tab) close event!!" alt="User is trying to leave! Set confirm alert on browser(tab) close event!!" height="165" width="800" /&gt;&lt;br /&gt;&lt;br /&gt;By
 saying here &amp;quot;every time browser unloads the page&amp;quot;; I mean to say that 
whenever page loads or postback happens the browser onbeforeunload event
 will be executed. So, event a button submit or a link submit which 
causes page to postback would tend to execute the browser onbeforeunload
 event to fire!&lt;br /&gt;&lt;br /&gt;So, now the hurdle is how can we prevent the 
alert &amp;quot;Not to show when page is being postback&amp;quot; via any button/link 
submit? Answer is JQuery :)&lt;br /&gt;&lt;br /&gt;Idea is, you just need to set the 
script reference src to jQuery library and Set the window.onbeforeunload
 event to null when any input/link causes a page to postback.&lt;br /&gt;&lt;br /&gt;Below will be the complete code:&lt;br /&gt;&lt;br /&gt;&amp;lt;head runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;script src=&amp;quot;jquery.min.js&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;script language=&amp;quot;JavaScript&amp;quot; type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.onbeforeunload = confirmExit;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function confirmExit() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
 return &amp;quot;You are about to exit the system before freezing your 
declaration! If you leave now and never return to freeze your 
declaration; then they will not go into effect and you may lose tax 
deduction, Are you sure you want to leave now?&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(function() {&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;quot;a&amp;quot;).click(function() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.onbeforeunload = null;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(&amp;quot;input&amp;quot;).click(function() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.onbeforeunload = null;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So,
 By this post I have tried to set the confirm alert if user try to close
 the browser/tab or try leave the site by changing the url. I have 
attached a working example with this post &lt;a href="http://weblogs.asp.net/blogs/kaushal/BlogFiles/CloseConfirm1.1.zip"&gt;here&lt;/a&gt;. I hope someone might find it helpful.&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;b&gt;EDIT [26-February-2011]&lt;/b&gt;&lt;/span&gt;:
 I would like to edit this post here. I missed out to write that any 
control event that may cause a postback needs to be checked and set 
window.onbeforeunload = null; like I have set for Button Click or 
Hyperlink Click.&lt;/p&gt;
&lt;p&gt;For Example, IF you have a&amp;nbsp; Select/DropDownList 
control which is causing a postback then you need to set 
window.onbeforeunload = null; on click of &amp;quot;select&amp;quot; as below:&lt;/p&gt;
&lt;p&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;quot;select&amp;quot;).click(function() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.onbeforeunload = null;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=37050" width="1" height="1"&gt;</description><enclosure url="http://weblogs.asp.net/blogs/kaushal/BlogFiles/CloseConfirm1.1.zip" length="30515" type="application/x-zip-compressed" /><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/.NET/default.aspx">.NET</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/KaushalParik/default.aspx">KaushalParik</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushalparik27/default.aspx">kaushalparik27</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushal.net/default.aspx">kaushal.net</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/window.onbeforeunload/default.aspx">window.onbeforeunload</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/browser+close+event/default.aspx">browser close event</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/confirm+alert+on+browser+close+event/default.aspx">confirm alert on browser close event</category></item><item><title>Get rid from unwanted Skype group notification (going a bit offbeat here)</title><link>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2011/02/26/get-rid-from-unwanted-skype-group-notification-going-a-bit-offbeat-here.aspx</link><pubDate>Sat, 26 Feb 2011 04:50:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:37049</guid><dc:creator>kaushalparik</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/kaushalparik/rsscomments.aspx?PostID=37049</wfw:commentRss><comments>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2011/02/26/get-rid-from-unwanted-skype-group-notification-going-a-bit-offbeat-here.aspx#comments</comments><description>&lt;p&gt;In this post; I am going little offbeat this time. We all use &lt;a target="_blank" href="http://www.skype.com/intl/en/home"&gt;skype&lt;/a&gt; for professional contacts. We create categories to manage our contacts. We &lt;a target="_blank" href="http://www.ehow.com/how_5016035_create-group-skype.html"&gt;create chat groups&lt;/a&gt;/Conversation for a group discussion/chat. Whenever a new instant message come, skype gives instant popup notification at the bottom right corner near taskbar. This just like any other messanger.&lt;/p&gt;
&lt;p&gt;Sometimes, you would not like to get unwanted notification popup for the discussion on which you are not interested on. Don&amp;#39;t worry! You don&amp;#39;t need to leave the conversation becase the group/friends are important for you. :) There is one setting related to this in skype where you can set some words in which you are interested on which you want skype to give notification popup if any instant message by any group member contains any of those words.&lt;/p&gt;
&lt;p&gt;Below Image shows the setting popup message where you need to enter the preferred words followed by space&lt;/p&gt;
&lt;p&gt;&lt;img src="http://dotnetslackers.com/Community/blogs/kaushalparik/skype-1.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="http://dotnetslackers.com/Community/blogs/kaushalparik/skype-2.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So, finally :) I will only get popup notification if any of my friends write message which contains any of above words in it. Enjoy your conversation!&lt;/p&gt;
&lt;p&gt;At end, I also want to conclude that the similar setting is available for single contact conversation window also.&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=37049" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/General/default.aspx">General</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/skype+group+conversation/default.aspx">skype group conversation</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/skype/default.aspx">skype</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/skype+group/default.aspx">skype group</category></item><item><title>The ?? NULL-Coalescing Operator in C# </title><link>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2011/01/31/the-null-coalescing-operator-in-c.aspx</link><pubDate>Mon, 31 Jan 2011 11:11:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:37035</guid><dc:creator>kaushalparik</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/kaushalparik/rsscomments.aspx?PostID=37035</wfw:commentRss><comments>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2011/01/31/the-null-coalescing-operator-in-c.aspx#comments</comments><description>&lt;p&gt;In this blog entry, I am making a small note of ?? Operator. I think many of you may already have idea on this. Sometimes, it happens with me that I come across some basic things which I think I should be aware of from my academic or fresher level. ?? is one of them :)&lt;br /&gt;&lt;br /&gt;So, The scene how I came across to find for ?? operator is: I was thinking of modifying a field of a table design which was not nullable and I needed to&amp;nbsp; make it nullable with -1 as default value in Sql Server. But, then what should be done for previous records which already have NULL stored in them. First, I thought to manually run an update query to make NULL values to -1. But, I somehow don&amp;#39;t like the idea to be comfortable via hurting the existing data in the table. So? I thought like we have ISNULL() and COALESC() functions in Sql Server to manage and replace with NULL values. I googled to find any equivalent in C#. And There it is !!!!&lt;br /&gt;&lt;br /&gt;?? Operator is called null-coalescing operator and its is used to define a default value for NULL result or Nullable types that you may arise in your code.&lt;br /&gt;&lt;br /&gt;Here is one simple example in above case:&lt;br /&gt;Int64? NullableFieldInfoFromDb = //--some value which can be null&lt;br /&gt;if((NullableFieldInfoFromDb ?? -1) == -1) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //--some code to follow &lt;br /&gt;&lt;br /&gt;see here! I dont have to bother for previous NULL vlues which are already there in the database for this field because IF the code came across the NULL value then ?? Operator will replace it with -1 value. This way I didnt have to check/test it for both NULL and -1 values in if(...) condition.&lt;br /&gt;&lt;br /&gt;Second is one interesting situation when I needed it. &lt;br /&gt;I need to implement one validation check that user should not be able to enter/input duplicate family members via UI provided to them. Here only option/way to put such type of validation check in my situation is: &lt;br /&gt;Check for all these fields: Suffix + FirstName + MiddleName + LastName; against the user input. But, here Suffix and MiddleName fields are Nullable fields which can create problem/exception if I directly use them to match in where condition in a LINQ Query.&lt;br /&gt;&lt;br /&gt;So, below is the RIGHT Query which helped me to validate duplicate family members:&lt;br /&gt;&lt;br /&gt;bool isFamilyMemberExists =&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (from x in context.FamilyRecords&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where (x.Suffix ?? string.Empty).Trim().ToLower().Equals(txtSuffixField.Text.Trim().ToLower()) &amp;amp;&amp;amp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x.FirstName.ToLower().Equals(txtFirstNameField.Text.Trim().ToLower()) &amp;amp;&amp;amp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (x.MiddleName ?? string.Empty).Trim().ToLower().Equals(txtMiddleNameField.Text.Trim().ToLower()) &amp;amp;&amp;amp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x.LastName.ToLower().Equals(txtLastNameField.Text.Trim().ToLower()) &amp;amp;&amp;amp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (x.Relationship ?? string.Empty).Trim().ToLower().Equals(cmbRelationCodeField.SelectedValue.ToLower())&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select x.FamilyRecordID).Any();&lt;br /&gt;if (isFamilyMemberExists)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //-- Raise Error &amp;quot;The Member is already exists.&amp;quot;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What I did in above Query is use ?? Operator to replace NULL values with &amp;quot;&amp;quot; empty string so even NULL values in the data for suffix and Relationship field would not cause any exception.&lt;br /&gt;&lt;br /&gt;So :) now I am aware of NULL-Coalescing C# Operator equivalent to ISNULL() and COALESC() functionalities in Sql Server. I still hope that many things will come that will feel to me similarly - &amp;quot;I should have already known about this thing earlier!!&amp;quot;. But, anyways I am happy to know someting late then to unaware totally.&lt;/p&gt;
&lt;p&gt;Here is the MSDN link for NULL-Coalesc Operator: &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/ms173224.aspx"&gt;?? Operator (C# Reference)&lt;/a&gt; And here is another link on a good use of this operator while working with LINQ to SQL: &lt;a target="_blank" href="http://weblogs.asp.net/scottgu/archive/2007/09/20/the-new-c-null-coalescing-operator-and-using-it-with-linq.aspx"&gt;The C# ?? null coalescing operator (and using it with LINQ)&lt;/a&gt;
by ScottGu. I came across this nice example while googling for ??/such functionality.&lt;br /&gt;&lt;br /&gt;hope it helps./.&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=37035" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/LinQ/default.aspx">LinQ</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/KaushalParik/default.aspx">KaushalParik</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushalparik27/default.aspx">kaushalparik27</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushal.net/default.aspx">kaushal.net</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Linq+To+SQL/default.aspx">Linq To SQL</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/_3F003F00_+in+LINQ/default.aspx">?? in LINQ</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/null-coalescing+operator/default.aspx">null-coalescing operator</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/_3F003F00_+Operator+in+C_2300_/default.aspx">?? Operator in C#</category></item><item><title>Part 2: LINQ Tips &amp; Tricks [Things to get you started efficiently]</title><link>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2010/12/23/part-2-linq-tips-amp-tricks-things-to-get-you-started-efficiently.aspx</link><pubDate>Thu, 23 Dec 2010 20:26:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:36978</guid><dc:creator>kaushalparik</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/kaushalparik/rsscomments.aspx?PostID=36978</wfw:commentRss><comments>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2010/12/23/part-2-linq-tips-amp-tricks-things-to-get-you-started-efficiently.aspx#comments</comments><description>&lt;p&gt;This blog entry is in continuation with my first post on &lt;a target="_blank" title="LINQ Tips &amp;amp; Tricks [Things to get you started efficiently]" href="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2010/12/23/part-1-linq-tips-amp-tricks-things-to-get-you-started-efficiently.aspx"&gt;Part 1: LINQ Tips &amp;amp; Tricks [Things to get you started efficiently]&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Continuing to share some other important tips that you can take care of while developing with LINQ.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;[9] Loading Options while working with tables in Relationships&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;You always need to struggle for performance as a LINQ Developer; perhaps 
because to understand better how internal mechanism works.&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;using &lt;/span&gt;(BEDataContext context = &lt;span style="color:blue;"&gt;new &lt;/span&gt;BEDataContext())&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color:blue;"&gt;var &lt;/span&gt;customers = &lt;span style="color:blue;"&gt;from &lt;/span&gt;cust &lt;span style="color:blue;"&gt;in &lt;/span&gt;context.Customers&lt;br /&gt;                    &lt;span style="color:blue;"&gt;select &lt;/span&gt;cust;&lt;br /&gt;    &lt;span style="color:blue;"&gt;foreach &lt;/span&gt;(&lt;span style="color:blue;"&gt;var &lt;/span&gt;customer &lt;span style="color:blue;"&gt;in &lt;/span&gt;customer)&lt;br /&gt;        Response.Write(customer.CustomerAddresses.Count().ToString());&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In above example, you will see in Sql Server Profiler that for each customer 
one query will be executed additional each times to get the total addresses 
count for that customer when you enumerates in foreach loop. Now, consider below 
re-written snippet:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;using &lt;/span&gt;(BEDataContext context = &lt;span style="color:blue;"&gt;new &lt;/span&gt;BEDataContext())&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color:blue;"&gt;var &lt;/span&gt;customers = &lt;span style="color:blue;"&gt;from &lt;/span&gt;cust &lt;span style="color:blue;"&gt;in &lt;/span&gt;context.Customers&lt;br /&gt;                    &lt;span style="color:blue;"&gt;select &lt;/span&gt;cust;&lt;br /&gt;    &lt;span style="color:#2b91af;"&gt;DataLoadOptions &lt;/span&gt;dataLoadOptions = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;DataLoadOptions&lt;/span&gt;();&lt;br /&gt;    dataLoadOptions.LoadWith&amp;lt;Customers&amp;gt;(A =&amp;gt; A.CustomerAddresses);&lt;br /&gt;    context.LoadOptions = dataLoadOptions;&lt;br /&gt;    &lt;span style="color:blue;"&gt;foreach &lt;/span&gt;(&lt;span style="color:blue;"&gt;var &lt;/span&gt;customer &lt;span style="color:blue;"&gt;in &lt;/span&gt;customer)&lt;br /&gt;        Response.Write(customer.CustomerAddresses.Count().ToString());&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;Simply in above example, with DataLoadingOptions we are infect just telling 
LINQ Query engine that while it fetches the Customer data; also fetch associated 
CustomerAddresses table record count for that particular Customer. The benefit 
is; only ONE query will be executed to get the final result.
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;[10] Overriding Database Modification Statements&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;If you have been thinking that using LINQ to SQL in your environment is not 
possible, perhaps because of requirements to use stored procedures for all 
modifications to the database, then you would be interested in knowing that the 
actual code that gets called to make the updates, including inserts and deletes, 
can be overridden.
&lt;/p&gt;
&lt;p&gt;Overriding the code called to insert, update, and delete is as simple as 
defining the appropriately named partial method with the appropriate signature. 
When you override this way, the DataContext change processor will call your 
partial method implementation for the database update, insert, or delete.
&lt;/p&gt;
&lt;p&gt;Example:
&lt;/p&gt;
&lt;p&gt;Think of having Northwind database dbml context class, and then partial class 
can be created as:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;public partial class &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;BEDataContext &lt;/span&gt;: System.Data.Linq.&lt;span style="color:#2b91af;"&gt;DataContext&lt;br /&gt;&lt;/span&gt;{&lt;br /&gt;    &lt;span style="color:blue;"&gt;partial void &lt;/span&gt;InsertPerson(Person instance)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color:#a31515;"&gt;&amp;quot;Insert override method called for Person {0}.&amp;quot;&lt;/span&gt;, instance.FirstName);&lt;br /&gt;    }&lt;br /&gt;    &lt;span style="color:blue;"&gt;partial void &lt;/span&gt;UpdatePerson(Person instance)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color:#a31515;"&gt;&amp;quot;Update override method was called for Person {0}.&amp;quot;&lt;/span&gt;, instance.FirstName);&lt;br /&gt;    }&lt;br /&gt;    &lt;span style="color:blue;"&gt;partial void &lt;/span&gt;DeletePerson(Person instance)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color:#a31515;"&gt;&amp;quot;Delete override method was called for Person {0}.&amp;quot;&lt;/span&gt;, instance.FirstName);&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Notice that the signature of the partial methods are [ACTION][EntityName] 
where ACTION is INSERT | UPDATE | DELETE and EntityName is &amp;ldquo;Person&amp;rdquo;. Once you 
call SubmitChanges() method then these partial methods will be called. IF you 
want default behavior to occur then you can simply call 
this.ExecuteDynamicInsert(Person instance), ExecuteDynamicUpdate(Person 
instance) and ExecuteDynamicDelete(Person instance) respectively for insert, 
update and delete. Please note that here it is developer&amp;rsquo;s responsibility to 
handle concurrency conflicts.
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;[11] Proper usage of Translate&amp;lt;T&amp;gt; method&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;There are some limitations I faced with LINQ to SQL. Probably it&amp;rsquo;s possible 
that I am unaware of the proper method but you will find over the net that it&amp;rsquo;s 
a common problem LINQ developer faced mostly with Dynamic Queries which are 
executed with &amp;ldquo;exec&amp;rdquo; statement in Stored Procedures. So, the problem is 
regarding- Stored Procedure having Dynamic &amp;ldquo;Select&amp;rdquo; Queries. When you try to 
drop a Stored Procedure (which contains Dynamic Sql Query or Queries or having 
Temporary tables) from Solution Explorer to dbml file it&amp;rsquo;s quite possible that 
instead of generating correct return type for the method it generates &amp;ldquo;int&amp;rdquo; as 
the return type of that method. 
&lt;/p&gt;
&lt;p&gt;What should be done in this case then? There are alternatives. One of which 
is using Translate&amp;lt;T&amp;gt; method. Translate&amp;lt;T&amp;gt; is similar to 
ExetureQuery method. The method actually translates the query results in to 
sequence of objects. The difference is- we pass Sql statement string as 
parameter in ExecuteQuery method while in Translate&amp;lt;T&amp;gt; we pass 
System.Data.Common.DbDataReader like SqlDataReader. 
&lt;/p&gt;
&lt;p&gt;So, the Question is how this method would help to generate correct sequence 
of object while the Stored Procedure contains Dynamic Select Query? The idea is 
you can simply create and execute SqlCommand for that Stored Procedure and 
initialize SqlDataReader with ExecuteReader() method which you can further pass 
to Translate&amp;lt;T&amp;gt; method to have correct result.
&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;SqlConnection &lt;/span&gt;sqlCn = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;SqlConnection&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;ConfigurationManager&lt;/span&gt;.ConnectionStrings[&lt;span style="color:#a31515;"&gt;&amp;quot;NWind&amp;quot;&lt;/span&gt;].ConnectionString))&lt;br /&gt;{&lt;br /&gt;    sqlCn.Open();&lt;br /&gt;    &lt;span style="color:#2b91af;"&gt;SqlCommand &lt;/span&gt;sqlCmd = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;SqlCommand&lt;/span&gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;usp_DynamicSelectQuerySP&amp;quot;&lt;/span&gt;, sqlCn);&lt;br /&gt;    sqlCmd.CommandType = &lt;span style="color:#2b91af;"&gt;CommandType&lt;/span&gt;.StoredProcedure;&lt;br /&gt;    &lt;span style="color:#2b91af;"&gt;SqlDataReader &lt;/span&gt;sqlReader = sqlCmd.ExecuteReader();&lt;br /&gt;    &lt;span style="color:blue;"&gt;using &lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;NWindDataContext &lt;/span&gt;context = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;NWindDataContext&lt;/span&gt;())&lt;br /&gt;        &lt;span style="color:#2b91af;"&gt;IEnumerable&lt;/span&gt;&amp;lt;Customer&amp;gt; custs = context.Translate&amp;lt;Customer&amp;gt;(sqlReader);&lt;br /&gt;    &lt;span style="color:blue;"&gt;foreach &lt;/span&gt;(Customer c &lt;span style="color:blue;"&gt;in &lt;/span&gt;custs)&lt;br /&gt;        &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color:#a31515;"&gt;&amp;quot;ID = {0} : Name = {1} : Contact = {2}&amp;quot;&lt;/span&gt;, c.CustomerID, c.CompanyName, c.ContactName);&lt;br /&gt;    sqlCn.Close();&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Another situational usage of Translate&amp;lt;T&amp;gt; method is for integrating 
LINQ to SQL code into existing ADO.NET code.
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;[12] Stored Procedures return type with Dynamic Sql or Temporary 
tables&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;This is regarding the possible problem/situation I already talked about in 
previous point. Working with the Stored Procedure along with; LINQ to SQL dbml 
need a way for figuring out what will be the return type of the method created 
by that stored procedure. To do this without actually running the actual stored 
procedure; it uses the SET FMTONLY command set to ON so that SQL Server can just 
parse the stored procedure for correct return type. But, this parsing does not 
extend or generate proper return types if there are any Dynamic Sql or temporary 
tables being used. So you must change the return type from the scalar integer to 
known type you want it to be. What happening is, when the stored procedure is 
dragged and dropped on the DBML designer, Visual Studio is generating wrong 
signature for the stored procedure return typ. That is, instead of returning a 
result set as output, an integer value is set as return type.
&lt;/p&gt;
&lt;p&gt;So, finally here is the alternative when correct return type is not being 
generated in LINQ to SQL dbml designer file. 
&lt;/p&gt;
&lt;p&gt;Hack/possible solution is: 
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Delete the stored procedure method from dbml file as well as drop it from 
database. Create a dummy stored procedure with the similar signatures, 
parameters (if any), output fields (if any) and select fields that Dynamic Sql 
consists of. This can be a simple select statement without any panic or 
conditions; a simplified version of the same SP. 
&lt;/li&gt;
&lt;li&gt;Once you create it; drag &amp;amp; drop it on dbml and you notice that dbml 
designer now have correct return type for the method just because now the dummy 
SP doesn&amp;rsquo;t have dynamic Sql. That&amp;rsquo;s it. 
&lt;/li&gt;
&lt;li&gt;Now you can remove/alter the dummy SP with the actual one that contains 
Dynamic Sql.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;b&gt;[13] Setting DataContext.ObjectTrackingEnabled Property&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;ObjectTrackingEnabled Property tells the LINQ to SQL to track or not to track 
the original value and object identity for the DataContext. We can understand 
that tracking the original values would be only requiring when you are inseting, 
updating or deleting the records (DML operations) and certainly not at the time 
of retrieval or simple at the time of selecting the records. That means, we do 
not need to bear the heavy cost of object tracking service. So, if we set it 
off/false then it improves performance at retrieval time, because there are 
fewer items to track.
&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;using &lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;NWindDataContext &lt;/span&gt;context = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;NWindDataContext&lt;/span&gt;())&lt;br /&gt;{&lt;br /&gt;    context.ObjectTrackingEnabled = &lt;span style="color:blue;"&gt;false&lt;/span&gt;;&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;Here is one exception point to be noted is that: Deferred LINQ Queries 
require object tracking to be enabled true.
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;[14] Try to separate DataContext dbml class&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;This might not be possible in almost cases but you can think of separating 
database objects as a single unit of work and create separate DataContext 
classes. Since we consider DataContext dbml class as a whole database and not as 
a single unit of work/module we used to put all the tables, methods in one 
DataContext class only. Separating DataContext based on workspace would minimize 
in-memory cost of those database objects as well as object tracking cost would 
be minimized. 
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;[15] UpdateCheck Property usage (Concurrency Check)&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;LINQ to SQL supports Concurrency Check with sql timestamp column. The 
property name is &amp;ldquo;UpdateCheck&amp;rdquo; for each field of the database object. You can 
turn this off, if it&amp;rsquo;s not required to improve the performance. To access/change 
it, open the dbml file select the table object&amp;rsquo;s fields for which you don&amp;rsquo;t want 
to have UpdateCheck and press F4 to open the property dialog box. You will find 
last property option &amp;ldquo;UpdateCheck&amp;rdquo; with possible options: &amp;ldquo;Never&amp;rdquo;, &amp;ldquo;Always&amp;rdquo; and 
&amp;ldquo;When Changed&amp;rdquo; with default &amp;ldquo;Always&amp;rdquo; option.
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;[16] Only fetch records that are required&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;Take a simple example of binding a gridview. You are paginating the records 
as usual to any application then consider using powerful LINQ to SQL standard 
operators/methods like Take &amp;amp; Skip.
&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;public &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;lt;Employee&amp;gt; GetEmployee(&lt;span style="color:blue;"&gt;int &lt;/span&gt;PageIndex, &lt;span style="color:blue;"&gt;int &lt;/span&gt;PageSize)&lt;br /&gt;{&lt;br /&gt;  &lt;span style="color:blue;"&gt;using &lt;/span&gt;(NwindDataContext context = &lt;span style="color:blue;"&gt;new &lt;/span&gt;NwindDataContext ())&lt;br /&gt;  {&lt;br /&gt;    &lt;span style="color:blue;"&gt;return &lt;/span&gt;context. Employee&lt;br /&gt;           .Take&amp;lt; Employee &amp;gt;(PageSize)&lt;br /&gt;           .Skip&amp;lt; Employee &amp;gt;(PageIndex * PageSize)&lt;br /&gt;           .ToList&amp;lt; Employee &amp;gt;();&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;hope the tips would help./.&lt;/p&gt;
&lt;p&gt;Reference: &lt;a target="_blank" title="Pro LINQ: Language Integrated Query in C# 2010" href="http://www.apress.com/book/view/9781430226536"&gt;Apress: Pro LINQ: Language Integrated Query in C# 2010&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;more to come on EF &amp;amp; LINQ.&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=36978" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/ADO.NET/default.aspx">ADO.NET</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/.NET/default.aspx">.NET</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/LinQ/default.aspx">LinQ</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/KaushalParik/default.aspx">KaushalParik</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushalparik27/default.aspx">kaushalparik27</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushal.net/default.aspx">kaushal.net</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Linq+To+SQL/default.aspx">Linq To SQL</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/EF/default.aspx">EF</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/IQueryable/default.aspx">IQueryable</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/IEnumerable/default.aspx">IEnumerable</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Deferred+Queries/default.aspx">Deferred Queries</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/DataContext/default.aspx">DataContext</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/LINQ+Tips/default.aspx">LINQ Tips</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/LINQ+Tips+_2600_amp_3B00_+Tricks/default.aspx">LINQ Tips &amp;amp; Tricks</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/LoadWith/default.aspx">LoadWith</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Stored+Procedures+return+type+int/default.aspx">Stored Procedures return type int</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Skip+method/default.aspx">Skip method</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/ExecuteDynamicDelete/default.aspx">ExecuteDynamicDelete</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/ObjectTrackingEnabled/default.aspx">ObjectTrackingEnabled</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/ExecuteDynamicInsert/default.aspx">ExecuteDynamicInsert</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/UpdateCheck/default.aspx">UpdateCheck</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/DataLoadOptions/default.aspx">DataLoadOptions</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/ExecuteDynamicUpdate/default.aspx">ExecuteDynamicUpdate</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Take+method/default.aspx">Take method</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Translate_2600_lt_3B00_T_2600_gt_3B00_+method/default.aspx">Translate&amp;lt;T&amp;gt; method</category></item><item><title>Part 1: LINQ Tips &amp; Tricks [Things to get you started efficiently]</title><link>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2010/12/23/part-1-linq-tips-amp-tricks-things-to-get-you-started-efficiently.aspx</link><pubDate>Thu, 23 Dec 2010 04:25:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:36975</guid><dc:creator>kaushalparik</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/kaushalparik/rsscomments.aspx?PostID=36975</wfw:commentRss><comments>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2010/12/23/part-1-linq-tips-amp-tricks-things-to-get-you-started-efficiently.aspx#comments</comments><description>&lt;p&gt;While my development with LINQ I got around some helps, links, small 
tips and tricks which makes life much easier, improves query formulation
 capabilities and speedup the program execute performance. Here I am 
sharing some of the tips I found as a LINQ Developer.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;[1] Use the var Keyword When Confused&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Use var keyword as return type especially when you are capturing 
sequence of anonymous classes. For example, joining of 2 tables and 
retrieving a sequence of records containing (some/few) fields of both 
the tables. I appreciate the developers who understand and know exactly 
what data type is contained in the sequence they are retrieving. But, 
anyhow you get stuck and don&amp;rsquo;t know the sequence IEnumerable&amp;lt;T&amp;gt; 
holds what data type T; then var is the good choice.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;[2] Use the Cast or OfType Operators for Legacy Collections&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;You notice that LINQ standard operators and methods always been 
called only on the type of collections/sequence which are implementing 
IEnumerable &amp;lt;T&amp;gt; interface. Something trivial to know that none of 
the legacy Collection types which are inside System.Collection namespace
 implements IEnumerable &amp;lt;T&amp;gt; interface. Then how would you use LINQ
 operators and methods against them? The answer is: Cast and OfType LINQ
 operators.&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:green;"&gt;//--Cast Example:&lt;br /&gt;//--create a legacy collection of type ArrayList.&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#2b91af;"&gt;ArrayList &lt;/span&gt;nameList = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;ArrayList&lt;/span&gt;();&lt;br /&gt;nameList.Add(&lt;span style="color:#a31515;"&gt;&amp;quot;Kaushal&amp;quot;&lt;/span&gt;);&lt;br /&gt;nameList.Add(&lt;span style="color:#a31515;"&gt;&amp;quot;Pooja&amp;quot;&lt;/span&gt;);&lt;br /&gt;nameList.Add(&lt;span style="color:#a31515;"&gt;&amp;quot;Naman&amp;quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;gt; firstnames = nameList.Cast&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;gt;().Where(n =&amp;gt; n.Length &amp;gt; 5);&lt;br /&gt;&lt;span style="color:blue;"&gt;foreach &lt;/span&gt;(&lt;span style="color:blue;"&gt;string &lt;/span&gt;name &lt;span style="color:blue;"&gt;in &lt;/span&gt;firstnames)&lt;br /&gt;    Response.Write(name);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:green;"&gt;//--OfType Example:&lt;br /&gt;//--create a legacy collection of type ArrayList.&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#2b91af;"&gt;ArrayList &lt;/span&gt;nameList = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;ArrayList&lt;/span&gt;();&lt;br /&gt;nameList.Add(&lt;span style="color:#a31515;"&gt;&amp;quot;Kaushal&amp;quot;&lt;/span&gt;);&lt;br /&gt;nameList.Add(&lt;span style="color:#a31515;"&gt;&amp;quot;Pooja&amp;quot;&lt;/span&gt;);&lt;br /&gt;nameList.Add(&lt;span style="color:#a31515;"&gt;&amp;quot;Naman&amp;quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#2b91af;"&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;gt; firstnames = nameList.OfType&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;gt;().Where(n =&amp;gt; n.Length &amp;gt; 5);&lt;br /&gt;&lt;span style="color:blue;"&gt;foreach &lt;/span&gt;(&lt;span style="color:blue;"&gt;string &lt;/span&gt;name &lt;span style="color:blue;"&gt;in &lt;/span&gt;names)&lt;br /&gt;    Response.Write(name);&lt;/pre&gt;
&lt;p&gt;Both will result in &amp;ldquo;Kaushal&amp;rdquo; here.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;[3] Don&amp;rsquo;t Assume a Query Is Bug-Free&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Check out this example:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;var &lt;/span&gt;names =&lt;br /&gt;    &lt;span style="color:blue;"&gt;from &lt;/span&gt;fullname &lt;span style="color:blue;"&gt;in &lt;/span&gt;person&lt;br /&gt;    &lt;span style="color:blue;"&gt;where &lt;/span&gt;fullname.EndsWith(&lt;span style="color:#a31515;"&gt;&amp;quot;Parik&amp;quot;&lt;/span&gt;)&lt;br /&gt;    &lt;span style="color:blue;"&gt;select &lt;/span&gt;fullname;&lt;br /&gt;&lt;span style="color:blue;"&gt;foreach &lt;/span&gt;(&lt;span style="color:blue;"&gt;var &lt;/span&gt;name &lt;span style="color:blue;"&gt;in &lt;/span&gt;names)&lt;br /&gt;    &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(name);&lt;/pre&gt;
&lt;p&gt;By looking at the above example; it appears that query execution is 
occurring just when names variable of type var is initialized, but that 
is not the case. The reason is LINQ queries are often &amp;ldquo;deferred&amp;rdquo; and not
 executed when it appears to be executing when you are calling them. 
Because &amp;ldquo;Select&amp;rdquo; and &amp;ldquo;Where&amp;rdquo; statements are deferred operators, above 
query will not be executed until you enumerate it. The query is merely 
being declared, or defined, but not performed in the very first 
statement of above example. Query execution will happen when foreach 
statement is executed. So, finally we can say that above query that we 
have written is &amp;ldquo;deferred&amp;rdquo;! So, keep twice watch on your queries, they 
might be culprit for slow performance or internal exception.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;[4] Take Advantage of Deferred Query&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Now as we are families that Deferred Queries don&amp;rsquo;t execute until you 
enumerate them. Ultimately Deferred Query returns an 
IEnumerable&amp;lt;T&amp;gt; can be enumerated over, time and time again, 
obtaining the latest data from the data source. You don&amp;rsquo;t need to 
actually call or, as we earlier pointed out, declare the query again.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;[5] Use the DataContext Log&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;This is something similar with using &amp;ldquo;Sql Server Profiler&amp;rdquo; tool we 
are using when working with our database to debug the query execution. 
You can always use &amp;ldquo;SQL Server Profiler&amp;rdquo; to view the Sql query generated
 by LINQ, but there is a DataContext.Log Property that you can assign to
 a TextWriter to view the generated Sql query. Remember that your LINQ 
DataContext class inherits from System.Data.Linq.DataContext, which 
means LINQ DataContext class is already having some pre-defined in-built
 functionality like this Log property.&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;using &lt;/span&gt;(NorthwindDataContext context = &lt;span style="color:blue;"&gt;new &lt;/span&gt;NorthwindDataContext())&lt;br /&gt;{&lt;br /&gt;    context.Log = &lt;span style="color:blue;"&gt;new &lt;/span&gt;DebuggerWriter();&lt;br /&gt;&lt;br /&gt;    Customer customer = context.Customers.Single&amp;lt;Customer&amp;gt;&lt;br /&gt;                        (c =&amp;gt; c.CustomerID.Equals(&lt;span style="color:#a31515;"&gt;&amp;quot;KPN1&amp;quot;&lt;/span&gt;));&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;&lt;b&gt;[6 ] Always Consume DataContext Class object inside using(&amp;hellip;) statement&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The DataContext dbml class implements IDisposable interface; so, its 
always good practice to declare and use the DataContext class inside 
using(&amp;hellip;) scope sothat object will be disposed immediately after the 
defined scope. This is something looks a minor thing but later on in a 
heavy database operation related application you may end up with 
&amp;ldquo;Maximum Connection Pooling reached&amp;rdquo; error if DataContext objects don&amp;rsquo;t 
disposed correctly.&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;using &lt;/span&gt;(NWindDataContext context = &lt;span style="color:blue;"&gt;new &lt;/span&gt;NWindDataContext())&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color:blue;"&gt;var &lt;/span&gt;fullnames = &lt;span style="color:blue;"&gt;from &lt;/span&gt;names &lt;span style="color:blue;"&gt;in &lt;/span&gt;context.Persons&lt;br /&gt;                    &lt;span style="color:blue;"&gt;where &lt;/span&gt;names.FirstName.ToLower().EndsWith(&lt;span style="color:#a31515;"&gt;&amp;quot;parik&amp;quot;&lt;/span&gt;)&lt;br /&gt;                    &lt;span style="color:blue;"&gt;select &lt;/span&gt;names;&lt;br /&gt;    &lt;span style="color:green;"&gt;//--further code&lt;br /&gt;&lt;/span&gt;}&lt;/pre&gt;
&lt;p&gt;&lt;b&gt;[7] Use the LINQ Forum&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Got stuck somewhere? Don&amp;rsquo;t forget that is a community forum dedicated
 to LINQ at MSDN com (http://www.linqdev.com). This community forum is 
monitored by Microsoft developers, and you will find a wealth of 
knowledgeable resources and threads there.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;[8 ] Use tool like &lt;a target="_blank" title="LINQPad" href="http://www.linqpad.net"&gt;LinqPad&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The success behind a LINQ application that you develop lies behind 
the performance of the query that you formulate. You can use any third 
party tool like I prefer to use &lt;a target="_blank" title="LINQPad" href="http://www.linqpad.net"&gt;LINQPad&lt;/a&gt; (by Joseph Albahari) while my development with LINQ. 
Actually, quick since a long time after I got to know about this tool 
and I was impressed so much that I thought to why not I get aware 
something about such nice and intelligent tool before. Life would have 
become easier!&lt;/p&gt;
&lt;p&gt;hope the tips would help./.&lt;/p&gt;
&lt;p&gt;Reference: &lt;a target="_blank" title="Pro LINQ: Language Integrated Query in C# 2010" href="http://www.apress.com/book/view/9781430226536"&gt;Apress: Pro LINQ: Language Integrated Query in C# 2010&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;more to come on EF &amp;amp; LINQ.&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=36975" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/ADO.NET/default.aspx">ADO.NET</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/.NET/default.aspx">.NET</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/LinQ/default.aspx">LinQ</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/KaushalParik/default.aspx">KaushalParik</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushalparik27/default.aspx">kaushalparik27</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushal.net/default.aspx">kaushal.net</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Linq+To+SQL/default.aspx">Linq To SQL</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/EF/default.aspx">EF</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/IQueryable/default.aspx">IQueryable</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/IEnumerable/default.aspx">IEnumerable</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Deferred+Queries/default.aspx">Deferred Queries</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/DataContext/default.aspx">DataContext</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/CAST/default.aspx">CAST</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/LinqPad/default.aspx">LinqPad</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/LINQ+Tips/default.aspx">LINQ Tips</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/OfType/default.aspx">OfType</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/var+keyword/default.aspx">var keyword</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/LINQ+Tips+_2600_amp_3B00_+Tricks/default.aspx">LINQ Tips &amp;amp; Tricks</category></item><item><title>LINQ – Querying the Data</title><link>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2010/12/21/linq-querying-the-data.aspx</link><pubDate>Tue, 21 Dec 2010 02:29:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:36971</guid><dc:creator>kaushalparik</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/kaushalparik/rsscomments.aspx?PostID=36971</wfw:commentRss><comments>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2010/12/21/linq-querying-the-data.aspx#comments</comments><description>&lt;p&gt;This is one of my posts based on LINQ subject on which I gratefully able to work a lot since last one and half year and I am hoping for myself to have some of good posts on EF &amp;amp; LINQ. In this post, I am going a bit theoretical here.&lt;br /&gt;&lt;br /&gt;As the name implies, LINQ is all about querying for the data and retrieving the resultant sequence of the same. Queries which return set of matching objects or subset of fields of matching an object or set of objects. The result or the return set of object by the LINQ is called &amp;ldquo;sequence&amp;rdquo;. This &amp;ldquo;sequence&amp;rdquo; generally be of type IEnumerable &amp;lt;T&amp;gt; where T is the data type of the object stored in the sequence. For example, if you have a sequence of integers, they would be stored in a variable of type IEnumerable&amp;lt;int&amp;gt;.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;span style="text-decoration:underline;"&gt;&lt;b&gt;LINQ to Objects&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;LINQ to Objects is the API dedicated to working with querying objects, arrays and in-memory data collections. Example is, querying a string Array.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;string[] greetings = {&amp;quot;Hi Kaushal Parik&amp;quot;, &amp;quot;Hi Pooja Parik&amp;quot;, &amp;quot;Hi Naman Parik&amp;quot;};&lt;br /&gt;var items =&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from s in greetings&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where s.StartsWith(&amp;quot;Naman&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select s;&lt;br /&gt;&lt;br /&gt;foreach (var item in items)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(item);&lt;br /&gt;&lt;br /&gt;Result will be: Hi Naman Parik&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;span style="text-decoration:underline;"&gt;&lt;b&gt;LINQ to Dataset&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;LINQ to Dataset is the name given to the LINQ API for Datasets. LINQ to Dataset is the faster and easier way to query cached data in Datasets. This is specifically useful when we need to query on consolidated data from one of more data sources. LINQ to Dataset doesn&amp;rsquo;t mean to replace ADP.NET 2.0 but its build/extended upon ADO.NET 2.0 architecture. So, existing ADO.NET 2.0 code will continue to run functionally correct in a LINQ to Dataset application.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;DataSet ds = new DataSet();&lt;br /&gt;var employees = from e in ds.Tables[0].AsEnumerable()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select new&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; eid = e.Field&amp;lt;string&amp;gt;(&amp;quot;EmployeeID&amp;quot;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ename = e.Field&amp;lt;string&amp;gt;(&amp;quot;FullName&amp;quot;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esalary = e.Field&amp;lt;string&amp;gt;(&amp;quot;Salary&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration:underline;"&gt;&lt;b&gt;LINQ to SQL&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;LINQ to SQL is the name given to the IQueryable&amp;lt;T&amp;gt; API that allows LINQ queries to work with Microsoft&amp;rsquo;s SQL Server database. This requires you to have reference of the System.Data.Linq dll assembly in your project.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;var customers =&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from c in dbContext.Customers&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where c.City.Equals(&amp;quot;Ahmedabad&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select c;&lt;br /&gt;&lt;br /&gt;foreach (var cust in custs)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(&amp;quot;{0}&amp;quot;, cust.CompanyName);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration:underline;"&gt;&lt;b&gt;LINQ to XML&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;LINQ to XML is the name given to the LINQ API dedicated to working with XML. This requires you to have reference of the System.Xml.Linq dll assembly in your project&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;using System;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Xml.Linq;&lt;br /&gt;&lt;br /&gt;XElement customers = XElement.Parse(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @&amp;quot;&amp;lt;customers&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;customer&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;id&amp;gt;1&amp;lt;/id&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;name&amp;gt;kaushal parik&amp;lt;/name&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/customer&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;customer&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;id&amp;gt;2&amp;lt;/id&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;name&amp;gt;Pooja parik&amp;lt;/name&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/customer&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;customer&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;id&amp;gt;3&amp;lt;/id&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;name&amp;gt;Naman parik&amp;lt;/name&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/customer&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/customers&amp;gt;&amp;quot;);&lt;br /&gt;&lt;br /&gt;var names =&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from cust in customers.Elements(&amp;quot;customer&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where (string) book.Element(&amp;quot;author&amp;quot;) == &amp;quot;Joe Rattz&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select cust.Element(&amp;quot;name&amp;quot;);&lt;br /&gt;&lt;br /&gt;foreach(var name in names)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(name.Value);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration:underline;"&gt;&lt;b&gt;LINQ to Entities&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;LINQ to Entities is the name given to the LINQ API that is used to interface with a database. LINQ to Entities separates physical database and the entity object model by injecting logical mapping in between them which simply results in greater flexibility. &lt;/p&gt;
&lt;p&gt;hope this helps./. &lt;/p&gt;
&lt;p&gt;more to come on EF &amp;amp; Linq.&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=36971" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/LinQ/default.aspx">LinQ</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/KaushalParik/default.aspx">KaushalParik</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushalparik27/default.aspx">kaushalparik27</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushal.net/default.aspx">kaushal.net</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Linq+To+SQL/default.aspx">Linq To SQL</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/EF/default.aspx">EF</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Linq+to+Entities/default.aspx">Linq to Entities</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/LINQ+to+Dataset/default.aspx">LINQ to Dataset</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Linq+to+XML/default.aspx">Linq to XML</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Linq+to+Object/default.aspx">Linq to Object</category></item><item><title>Announcing Visual Studio 2010 Service Pack 1 Beta</title><link>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2010/12/09/announcing-visual-studio-2010-service-pack-1-beta.aspx</link><pubDate>Thu, 09 Dec 2010 02:47:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:36964</guid><dc:creator>kaushalparik</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/kaushalparik/rsscomments.aspx?PostID=36964</wfw:commentRss><comments>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2010/12/09/announcing-visual-studio-2010-service-pack-1-beta.aspx#comments</comments><description>&lt;p&gt;Somasegar has announced on his &lt;a target="_blank" href="http://blogs.msdn.com/b/somasegar/archive/2010/12/07/visual-studio-2010-momentum.aspx"&gt;blog entry&lt;/a&gt; that Visual Studio 2010 Service Pack 1 Beta is available and now ready for download! &lt;br /&gt;&lt;br /&gt;MVP Groups and MSDN subscribers can download the beta immediately with general availability on December 9,2010. It is even exciting to know that SP 1 Beta comes with a &amp;ldquo;&lt;a target="_blank" href="http://go.microsoft.com/fwlink/?LinkId=207552"&gt;go live&lt;/a&gt;&amp;rdquo; license which means you can start using the product for production related work (but I still wonder why they released it as &amp;quot;Beta&amp;quot; then!).&lt;br /&gt;&lt;br /&gt;The focus is on improving the overall experience in a few important areas, such as unit testing, support for GPU acceleration in C++ applications, and offline help. Some of the &lt;i&gt;improvements&lt;/i&gt; that come with Service Pack Beta 1:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Help Viewer&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .NET 3.5 Unit Testing for&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IntelliTrack support for 64bit and SharePoint projects&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Performance Wizard for Silverlight&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Silverlight Tools for Visual Studio 2010 4&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; VB runtime compiler switch&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Detailed information about the subject as well as download links for subscribers and for general developers can be found at &lt;a target="_blank" href="http://blogs.msdn.com/b/jasonz/archive/2010/12/07/announcing-visual-studio-2010-service-pack-1-beta.aspx"&gt;Jason zander&lt;/a&gt; blog.&lt;/p&gt;
&lt;p&gt;Any issues if you may arise with it can be submitted at &lt;a target="_blank" href="http://connect.microsoft.com/VisualStudio"&gt;Microsoft Connect&lt;/a&gt;. Some minor issues found &lt;a target="_blank" href="http://connect.microsoft.com/VisualStudio/feedback/details/629589/vs-2010-sp1-beta-cancel-install-bug"&gt;here&lt;/a&gt; and &lt;a target="_blank" href="http://connect.microsoft.com/VisualStudio/feedback/details/629649/cant-to-install-vs-2010-sp1-beta"&gt;here&lt;/a&gt; regarding download and installation.&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;b&gt;UPDATE&lt;/b&gt;&lt;/span&gt; &lt;i&gt;[10-December-2010]&lt;/i&gt;: Scott Hanselman blogged on SP1 Beta Release yesterday which contains informative updates on &amp;quot;whats new&amp;quot; and &amp;quot;updation/bug fixes&amp;quot; details concentrated in this release. Check out here: &lt;a target="_blank" href="http://www.hanselman.com/blog/VisualStudioExplosionVS2010SP1BETAReleasedAndContext.aspx"&gt;Visual Studio Explosion! - VS2010 SP1 *BETA* Released and Context&lt;/a&gt;&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=36964" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/KaushalParik/default.aspx">KaushalParik</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushalparik27/default.aspx">kaushalparik27</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushal.net/default.aspx">kaushal.net</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/VS2010+SP1+Beta/default.aspx">VS2010 SP1 Beta</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/IntelliTrack+support+for+64bit+and+SharePoint+projects/default.aspx">IntelliTrack support for 64bit and SharePoint projects</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/VS2010+Help+Viewer/default.aspx">VS2010 Help Viewer</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Performance+Wizard+for+Silverlight/default.aspx">Performance Wizard for Silverlight</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/VB+runtime+compiler+switch/default.aspx">VB runtime compiler switch</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Visual+Studio+2010+SP1+Beta/default.aspx">Visual Studio 2010 SP1 Beta</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/VS2010+Service+Pack+Beta+1/default.aspx">VS2010 Service Pack Beta 1</category></item><item><title>codeSubDirectories Element in web.config file (Order does matters!)</title><link>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2010/12/07/codesubdirectories-element-in-web-config-file-order-does-matters.aspx</link><pubDate>Tue, 07 Dec 2010 11:01:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:36961</guid><dc:creator>kaushalparik</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/kaushalparik/rsscomments.aspx?PostID=36961</wfw:commentRss><comments>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2010/12/07/codesubdirectories-element-in-web-config-file-order-does-matters.aspx#comments</comments><description>&lt;p style="font-size:12px;"&gt;&lt;b&gt;&lt;i&gt;Update: The article has been selected as &amp;quot;Article of the day&amp;quot; on 3rd Feb 2011 at official asp.net (&lt;a target="_blank" href="http://www.asp.net/Community/Articles/Default.aspx"&gt;http://www.asp.net&lt;/a&gt;) site&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Recently I came across a very interesting situation thru that I came to know that the order in which the codeSubDirectories defined is very important.&lt;/p&gt;
&lt;p&gt;We define codeSubDirectories section inside &amp;lt;Compilation /&amp;gt; section of web.config file in any asp.net application specially when we are having Class files in different languagues (C# &amp;amp; VB.NET) at the same time inside App_Code folder. So, the practice is to create different language folders inside App_Code and put the appropriate language class files inside those folders and define those folder names in &amp;lt;codeSubDirectories /&amp;gt;&amp;nbsp; section.&lt;/p&gt;
&lt;p&gt;Another possible situation is- when you want to seperate App_Code class files according to Modules of your application; You separete class files in different folder and put them in appropriate namespaces.&lt;/p&gt;
&lt;p&gt;Below is one example on how you define codeSubDirectories section; if suppose for example, you having 3 folder in your application&amp;#39;s App_Code folder namely mySubDir1, mySubDir2 and mySubDir3 respectively.&lt;br /&gt;&amp;lt;compilation&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;codeSubDirectories&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add directoryName=&amp;quot;mySubDir1&amp;quot;/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add directoryName=&amp;quot;mySubDir2&amp;quot;/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add directoryName=&amp;quot;mySubDir3&amp;quot;/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/codeSubDirectories&amp;gt;&lt;br /&gt;&amp;lt;/compilation&amp;gt;&lt;/p&gt;
&lt;p&gt;According to MSDN documentation: &amp;lt;codeSubDirectories /&amp;gt; Defines an ordered collection of subdirectories that contains files to compile at run time. Subdirectory names are relative to the App_Code directory. The build order is inferred from the top-down order of the codeSubDirectories collection. The App_Code directory is built last. However, there are no build order dependencies, which means that the build order is not significant.&lt;br /&gt;I think that what is documented above is somewhat misleading or may be I am mis-interpreting it because the documentation says &amp;quot;the build order is not significant&amp;quot;.&lt;/p&gt;
&lt;p&gt;Anyways, the problem that I was facing is: I was not able to access the namespace/class defined in some other folder in some fix pattern. A google search helped me to know: If we take above example. It&amp;#39;s not just a list but its an &amp;quot;Ordered&amp;quot; list. That means if you try to acccess Namespaces which are defined inside mySubDir2,mySubDir3 in mySubDir1 then you won&amp;#39;t able to do that. The reason is mySubDir1 is defined very first in the CodeSubDirectories list.&lt;/p&gt;
&lt;p&gt;Finally, conclusion in above example is:&lt;br /&gt;[1] Classes inside mySubDir1: you won&amp;#39;t be able to access class/namespaces which are defined inside mySubDir2 and mySubDir3. Reason: mySubDir1 is first in CodeSubDirectories order and won&amp;#39;t recognize the other classes which are further defined in other directoires.&lt;br /&gt;[2] Classes inside mySubDir2: you will be able to access class/namespaces which are defined inside mySubDir1 and mySubDir2 but you wont be able to access class/namespaces which are defined inside mySubDir3. Reason is mySubDir3 is defined as last inm order.&lt;br /&gt;[3] Classes inside mysubDir3: you will be able to access ALL class/namespaces which are defined in mySuibdir1, mySuibdir2 and mySuibdir3. Reason is because mySubDir is very last in the codeSubDirectories order.&lt;/p&gt;
&lt;p&gt;Isn&amp;#39;t that strange! This was a new thing to know for me :) &lt;br /&gt;So, when you come around a situation when you need to use mySubDir3&amp;#39;s Classes and namespaces inside mySubDir1 classes, then best solution to follow WAP model OR create separate dll class libraries.&lt;/p&gt;
&lt;p&gt;Below is the graphical representation of what I am saying in this blog entry:&lt;/p&gt;
&lt;p&gt;&lt;img style="border:1px solid black;" alt="codeSubDirectories Element in web.config file (Order does matters!)" src="http://dotnetslackers.com/Community/blogs/kaushalparik/codeSubDirectories.png" height="800" width="800" /&gt;&lt;/p&gt;
&lt;p&gt;hope it helps./.&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=36961" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/KaushalParik/default.aspx">KaushalParik</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushalparik27/default.aspx">kaushalparik27</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushal.net/default.aspx">kaushal.net</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Subfolders+inside+App_5F00_Code+folder/default.aspx">Subfolders inside App_Code folder</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/codeSubDirectories/default.aspx">codeSubDirectories</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/web_2E00_config/default.aspx">web.config</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/codeSubDirectories+order/default.aspx">codeSubDirectories order</category></item><item><title>Using Fiddler Http debugging tool for your localhost sites</title><link>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2010/12/04/using-fiddler-http-debugging-tool-for-your-localhost-sites.aspx</link><pubDate>Sat, 04 Dec 2010 10:34:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:36957</guid><dc:creator>kaushalparik</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/kaushalparik/rsscomments.aspx?PostID=36957</wfw:commentRss><comments>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2010/12/04/using-fiddler-http-debugging-tool-for-your-localhost-sites.aspx#comments</comments><description>&lt;p&gt;I prefer to use &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Fiddler_%28software%29"&gt;fiddler&lt;/a&gt; which is an awsome tool for tracing up the http trafic, to test the performance script result OR to generate the Visual Basic web test script for performance testing. While working on one of my live site it helped me a lot as a web debugger. BUT, unfortunately when I tried to test my localsite (http://localhost/mySite) then fiddler didn&amp;#39;t show me http traffic/session of my local sites. Just after investing few minutes on google I came to know about the fix of adding a &amp;quot;dot&amp;quot; in front of localhost! and guess, it worked!! Now, fiddler was showing me localhost site&amp;#39;s traffic result.&lt;/p&gt;
&lt;p&gt;The idea is: instead of browsing your localhost site as:&lt;/p&gt;
&lt;p&gt;http://localhost/mySite&lt;/p&gt;
&lt;p&gt;Browse the site with a &amp;quot;dot&amp;quot; infront of localhost as:&lt;/p&gt;
&lt;p&gt;http://localhost&lt;b&gt;.&lt;/b&gt;/mySite&amp;nbsp; OR&amp;nbsp; http://127.0.0.1&lt;b&gt;.&lt;/b&gt;/mySite (notice the &amp;quot;dot&amp;quot; that I have written in there in the address)&lt;/p&gt;
&lt;p&gt;That&amp;#39;s It! and fiddler started crawling my localhost site&amp;#39;s session. The small trick would help people who just consider this tool a junk on first trial for their localhost sites.The root cause of this problem is: Internet Explorer and the .NET Framework are bydefault set not to send requests for Localhost through any proxies, and as a proxy, Fiddler will not receive such traffic. &lt;/p&gt;
&lt;p&gt;You can also try another work-a-round by checking off a checkbox which says &amp;quot;Bypass proxy server for local addresses&amp;quot; which can be found at Internet Exploerer &amp;gt; Tools menu &amp;gt; Internet Options &amp;gt; Connections &amp;gt; Lan Settings &amp;gt; &amp;quot;Bypass proxy server for local addresses&amp;quot; Checkbox.&lt;/p&gt;
&lt;p&gt;The issue has been documeted &lt;a target="_blank" href="http://www.fiddler2.com/Fiddler/help/hookup.asp#Q-LocalTraffic"&gt;here&lt;/a&gt; as a known issue if anybody interested.&lt;/p&gt;
&lt;p&gt;Happy Hunting!&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=36957" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Kaushal/default.aspx">Kaushal</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/KaushalParik/default.aspx">KaushalParik</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushalparik27/default.aspx">kaushalparik27</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushal.net/default.aspx">kaushal.net</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/http+debugging/default.aspx">http debugging</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/fiddler+localhost/default.aspx">fiddler localhost</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/fiddler/default.aspx">fiddler</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/web+test/default.aspx">web test</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/using+fiddler+on+localhost/default.aspx">using fiddler on localhost</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/fiddler+not+working+for+localhost/default.aspx">fiddler not working for localhost</category></item><item><title>Silverlight 5 Announcement</title><link>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2010/12/03/silverlight-5-announcement.aspx</link><pubDate>Fri, 03 Dec 2010 06:50:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:36955</guid><dc:creator>kaushalparik</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/kaushalparik/rsscomments.aspx?PostID=36955</wfw:commentRss><comments>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2010/12/03/silverlight-5-announcement.aspx#comments</comments><description>&lt;p&gt;For those developers who are looking forward for Silverlight 5; there is one great new that: at the Silverlight FireStarter event MS unveiled the next release of Silverlight (that is version 5 beta); the next version of its rich Internet platform and previewed key features of the upcoming beta technology at its Silverlight Firestarter educational event for developers. The Sikverlight beta 5 version is having significantly added new features and other media capabilities, which make easier for developers to create premium media experiences and deliver RIA across browsers, desktops and devices.&lt;/p&gt;
&lt;p&gt;For more information on Announcing Silverlight 5; Check out ScottGu&amp;#39;s Blog entry here: &lt;a target="_blank" title="Announcing Silverlight 5" href="http://weblogs.asp.net/scottgu/archive/2010/12/02/announcing-silverlight-5.aspx"&gt;Announcing Silverlight 5&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And here is the detailed list of new features and enhancements announced in this version: &lt;a target="_blank" title="New Features Announced for Silverlight 5 Beta" href="http://weblogs.asp.net/lduveau/archive/2010/12/02/silverlight-5-preview.aspx"&gt;New Features Announced for Silverlight 5 Beta&lt;/a&gt;&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=36955" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/SilverLight/default.aspx">SilverLight</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Kaushal/default.aspx">Kaushal</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushal.net/default.aspx">kaushal.net</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushalparik+kaushalparik27/default.aspx">kaushalparik kaushalparik27</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Silgerlight+5/default.aspx">Silgerlight 5</category></item><item><title>Common Linq To SQL operation sheet</title><link>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2010/11/12/common-linq-to-sql-operation-sheet.aspx</link><pubDate>Fri, 12 Nov 2010 05:08:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:36947</guid><dc:creator>kaushalparik</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/kaushalparik/rsscomments.aspx?PostID=36947</wfw:commentRss><comments>http://dotnetslackers.com/Community/blogs/kaushalparik/archive/2010/11/12/common-linq-to-sql-operation-sheet.aspx#comments</comments><description>&lt;p&gt;friends, I didn&amp;#39;t remember about the real source where i got it but I found one handy sheet for common operation in Linq To SQL.&lt;/p&gt;
&lt;p&gt;I thought you guys will find it useful too. I have also attached PDF file with this blog entry which contains all the examples ni both C# and VB.NET.&lt;/p&gt;
&lt;p&gt;Hope it helps./.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Linq To SQL Sheet" src="http://dotnetslackers.com/Community/blogs/kaushalparik/Linq2SQLSheet.png" height="1179" width="900" /&gt;&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=36947" width="1" height="1"&gt;</description><enclosure url="http://dotnetslackers.com/Community/blogs/kaushalparik/attachment/36947.ashx" length="71010" type="application/zip" /><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/LinQ/default.aspx">LinQ</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/KaushalParik/default.aspx">KaushalParik</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/c_2300_/default.aspx">c#</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushalparik27/default.aspx">kaushalparik27</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/kaushal.net/default.aspx">kaushal.net</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Contains+in+Linq+To+SQL/default.aspx">Contains in Linq To SQL</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/right+outer+join+in+Linq+to+SQL/default.aspx">right outer join in Linq to SQL</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/left+outer+join+in+Linq+to+SQL/default.aspx">left outer join in Linq to SQL</category><category domain="http://dotnetslackers.com/Community/blogs/kaushalparik/archive/tags/Linq+To+SQL/default.aspx">Linq To SQL</category></item></channel></rss>
