<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://v900u039rux.maximumasp.com/Web/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>Manjula&amp;#39;s Blog : LINQ</title><link>http://v900u039rux.maximumasp.com/Web/blogs/mperera/archive/tags/LINQ/default.aspx</link><description>Tags: LINQ</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP2 (Build: 20611.960)</generator><item><title>LINQ - Part 2 - FAQs &amp; Answers</title><link>http://v900u039rux.maximumasp.com/Web/blogs/mperera/archive/2008/01/02/linq-part-2-faq-amp-answers.aspx</link><pubDate>Wed, 02 Jan 2008 05:42:00 GMT</pubDate><guid isPermaLink="false">3790bee0-d05b-4b84-a272-3ed522a0473a:130</guid><dc:creator>Manjula Perera</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://v900u039rux.maximumasp.com/Web/blogs/mperera/rsscomments.aspx?PostID=130</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://v900u039rux.maximumasp.com/Web/blogs/mperera/commentapi.aspx?PostID=130</wfw:comment><comments>http://v900u039rux.maximumasp.com/Web/blogs/mperera/archive/2008/01/02/linq-part-2-faq-amp-answers.aspx#comments</comments><description>&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I thought of listing down few Frequently Asked Questions about LINQ and their answers before proceeding to the technical details of it. This is mainly because I might have missed any&amp;nbsp;introductory information regarding LINQ.&amp;nbsp;Please refer to the below LINQ FAQ related web postings.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;&lt;a class="" title="LINQ FAQ at MSDN forum" href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=307705&amp;amp;SiteID=1" target="_blank"&gt;LINQ FAQ by Keith Farmer&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;&lt;a class="" href="http://www.hookedonlinq.com/Default.aspx?Page=LINQToSQLFAQ&amp;amp;AspxAutoDetectCookieSupport=1" target="_blank"&gt;Hooked on LINQ&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;More Links to LINQ&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;&lt;a class="" href="http://blogs.msdn.com/charlie/archive/2006/10/05/Links-to-LINQ.aspx" target="_blank"&gt;Links to LINQ&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;img src="http://v900u039rux.maximumasp.com/Web/aggbug.aspx?PostID=130" width="1" height="1"&gt;</description><category domain="http://v900u039rux.maximumasp.com/Web/blogs/mperera/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://v900u039rux.maximumasp.com/Web/blogs/mperera/archive/tags/LINQ/default.aspx">LINQ</category></item><item><title>LINQ - Part 1 - the new querying enhancement to C# and VB.Net</title><link>http://v900u039rux.maximumasp.com/Web/blogs/mperera/archive/2007/12/30/linq-the-new-querying-enhancement-to-c-and-vb.aspx</link><pubDate>Sun, 30 Dec 2007 13:23:00 GMT</pubDate><guid isPermaLink="false">3790bee0-d05b-4b84-a272-3ed522a0473a:127</guid><dc:creator>Manjula Perera</dc:creator><slash:comments>9</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://v900u039rux.maximumasp.com/Web/blogs/mperera/rsscomments.aspx?PostID=127</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://v900u039rux.maximumasp.com/Web/blogs/mperera/commentapi.aspx?PostID=127</wfw:comment><comments>http://v900u039rux.maximumasp.com/Web/blogs/mperera/archive/2007/12/30/linq-the-new-querying-enhancement-to-c-and-vb.aspx#comments</comments><description>&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I thought of&lt;strong&gt; &lt;/strong&gt;gathering some information about Microsoft&amp;#39;s latest querying technology and summerising that information&amp;nbsp;here so that readers of this Blog and the members of the &lt;a class="" title="Home" href="http://dnfug.com/Web/" target="_blank"&gt;.NetFoundry&lt;/a&gt; user group will benefit from it. There&amp;#39;s lot to talk about &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt;. Therefore I&amp;#39;ll split this article into several parts and publish separately.&amp;nbsp;Since this is the first article about &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt; in the user group I&amp;#39;ll start with an introductory and would try to give a glimps in to &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What is &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt;?&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;&lt;strong&gt;&lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt;&lt;/strong&gt; - &lt;strong&gt;L&lt;/strong&gt;anguage &lt;strong&gt;IN&lt;/strong&gt;tegrated &lt;strong&gt;Q&lt;/strong&gt;uery&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Is an extension to .Net compliant languages like C#, VB.Net and others&amp;nbsp;for general purpose querying&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Object based, language integrated way to query over data no matter from where that data came from or generated&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Is a universal querying mechanism where we can query objects, collections, text files,&amp;nbsp;relational data and XML&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Could retrieve data from any object that implements the &lt;a class="" href="http://www.winterdom.com/weblog/2006/10/13/RediscoveringIEnumerableltTgt.aspx" target="_blank"&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/a&gt; interface&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Is an integral part of Visual Studio 2008 and could incorporate with Visual Studio 2005 as an additional &lt;a class="" title="CTP Download" href="http://www.microsoft.com/downloads/details.aspx?familyid=1e902c21-340c-4d13-9f04-70eb5e3dceea&amp;amp;displaylang=en"&gt;CTP&amp;nbsp;download&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Used to overcome the impedance mismatch between programming languages and database&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;&lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt; has been separated into three main&amp;nbsp;areas. They are,&lt;/div&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;&lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt; to Object&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;&lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt; to ADO.Net (LINQ enabled ADO.Net)&lt;/div&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;&lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt; to SQL - DLINQ&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;&lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt; to DataSet&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;&lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt; to Entities&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;
&lt;div&gt;&lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt; to XML - XLINQ&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;
&lt;div&gt;Highly extensible&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;&lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt; Architecture&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The architecture of &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt; is depicted below and it is self explanatory.&lt;/p&gt;
&lt;p&gt;&lt;img title="LINQ Architecture" style="WIDTH:558px;HEIGHT:492px;" height="492" alt="LINQ Architecture" src="http://dnfug.com/Web/blogs/mperera/Architecture.JPG" width="558" align="middle" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Advantages of using &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;There&amp;#39;s a common syntax for querying any data source mentioned above. This eliminates the one source - one query language concept. I.e. for example Relational Data -&amp;gt; SQL, XML Documents -&amp;gt; XPath and .Net objects -&amp;gt; .Net built in operators such as foreach.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Able to use &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt; with .Net 1.x and .Net 2.0 objects&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Able to extend &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt; to support new classes and technologies&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Integrated to the .Net framework thereby accessible from any .Net compliant language (native code)&amp;nbsp;and make use of their stregths and compile time syntax&amp;nbsp;checking. E.g. it inherits the new C#&amp;nbsp;language features like,&lt;/div&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;Implicitly typed variables&amp;nbsp;e.g. &lt;em&gt;var&lt;/em&gt; keyword&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;&lt;a class="" href="http://weblogs.asp.net/scottgu/archive/2007/03/13/new-orcas-language-feature-extension-methods.aspx" target="_blank"&gt;Extension methods&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;&lt;a class="" href="http://weblogs.asp.net/scottgu/archive/2007/04/08/new-orcas-language-feature-lambda-expressions.aspx" target="_blank"&gt;Lambda expressions&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;&lt;a class="" href="http://weblogs.asp.net/scottgu/archive/2007/05/15/new-orcas-language-feature-anonymous-types.aspx" target="_blank"&gt;Anonymous types&lt;/a&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;&lt;a class="" href="http://msdn2.microsoft.com/en-us/library/bb397951.aspx" target="_blank"&gt;Expression Trees&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;
&lt;div&gt;Avoids dynamic creation of string queries within native code (e.g. C#)&amp;nbsp;and thereby avoiding the disadvantage of not having compile time checking of queries. I.e. eliminating mixture of native code and none native code. This also saves time on creating a dynamic query.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Intelli sense is available in Visual Studio&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Designer support&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Gives more power to the front-end programmer to&amp;nbsp;manipulate data&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Shorter learning curve&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Could access stored procedures and user defined functions in a relational database&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Disadvantages&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;Mainly focus on or support SQL Server but not Oracle or other databases such as MySQL, DB2. Others have to provide their own provider model or extension.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Lack of &amp;quot;Left/ Right&amp;quot; keywords in a Join even though the objectives are met&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Data manipulation logic/code is written in the application rather than the DB end in &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt; to SQL. &lt;/div&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;This would be a problem when we want to change the&amp;nbsp;logic without changing or re-compiling the application code&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Problem of viewing the execution plan and optimising the query&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;
&lt;div&gt;Database programmers would be jobless (Joke!) &lt;img src="http://dnfug.com/Web/emoticons/emotion-14.gif" alt="Devil" /&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Summery&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt; is a common method of accessing objects that implements IEnumerable &amp;lt;T&amp;gt; interface, relational data, text files and XML. This gives an extension and a cool new addition to the strength of .Net compliance languages even though there are several disadvantages of it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Rule Of Thumb&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m pretty sure &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt; will not replace classic SQL, T/SQL or PL/SQL but it will extend the&amp;nbsp;data manipulation&amp;nbsp;capability of the programmer. Its a pretty cool tool to be in our tool box.&amp;nbsp;We as the programmers must decide when to use it and when not to.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="" title="101 LINQ Samples" href="http://msdn2.microsoft.com/en-us/vcsharp/aa336746.aspx" target="_blank"&gt;MSDN - 101 &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt; Samples&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="" title="The LINQ project" href="http://msdn2.microsoft.com/en-us/netframework/aa904594.aspx" target="_blank"&gt;The &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt; project&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="http://weblogs.asp.net/scottgu/archive/tags/LINQ/default.aspx" target="_blank"&gt;ScottGu&amp;#39;s Blog&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="http://msdn.microsoft.com/msdnmag/issues/07/06/CSharp30/" target="_blank"&gt;The evolution of &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt; and its impact on the design of C#&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="http://www.winterdom.com/weblog/2006/10/13/RediscoveringIEnumerableltTgt.aspx" target="_blank"&gt;Rediscovering IEnumerable&amp;lt;T&amp;gt; - by Tomas Restrepo&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="" title="What is LINQ" href="http://geekswithblogs.net/technetbytes/archive/2007/04/30/112129.aspx" target="_blank"&gt;What is &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt;? by Saquib Ullah&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="http://linqinaction.net/" target="_blank"&gt;Dedicated website for&amp;nbsp;&lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="" title="Advantages and Disadvantages of LINQ" href="http://articles.techrepublic.com.com/5100-10878_11-5897968.html" target="_blank"&gt;Is &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;LINQ&lt;/font&gt; the future of database development? - by Arthur Fuller&lt;/a&gt;&lt;/p&gt;&lt;img src="http://v900u039rux.maximumasp.com/Web/aggbug.aspx?PostID=127" width="1" height="1"&gt;</description><category domain="http://v900u039rux.maximumasp.com/Web/blogs/mperera/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://v900u039rux.maximumasp.com/Web/blogs/mperera/archive/tags/LINQ/default.aspx">LINQ</category></item></channel></rss>