<?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 : C#</title><link>http://v900u039rux.maximumasp.com/Web/blogs/mperera/archive/tags/C_2300_/default.aspx</link><description>Tags: C#</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP2 (Build: 20611.960)</generator><item><title>SubSonic - Part 1 - An Introduction</title><link>http://v900u039rux.maximumasp.com/Web/blogs/mperera/archive/2008/01/03/subsonic-part-1-an-introduction.aspx</link><pubDate>Thu, 03 Jan 2008 06:27:00 GMT</pubDate><guid isPermaLink="false">3790bee0-d05b-4b84-a272-3ed522a0473a:131</guid><dc:creator>Manjula Perera</dc:creator><slash:comments>8</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://v900u039rux.maximumasp.com/Web/blogs/mperera/rsscomments.aspx?PostID=131</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://v900u039rux.maximumasp.com/Web/blogs/mperera/commentapi.aspx?PostID=131</wfw:comment><comments>http://v900u039rux.maximumasp.com/Web/blogs/mperera/archive/2008/01/03/subsonic-part-1-an-introduction.aspx#comments</comments><description>&lt;p&gt;&lt;strong&gt;&lt;img title="SubSonic logo" style="WIDTH:320px;HEIGHT:60px;" height="60" alt="SubSonic logo" src="http://dnfug.com/Web/blogs/mperera/subsonic_logo.png" width="320" /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is another interesting article about the new trends of the software industry. I would like to share the information I gathered while researching on this new toolset with the user group members and the readers of this blog.&amp;nbsp;I thought of writing about &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;SubSonic&lt;/font&gt; because it&amp;#39;s another way of accessing/ Querying the database (Actually, &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;SubSonic&lt;/font&gt; is a third party&amp;nbsp;toolset to auto generate the Data Access Layer (DAL) of our application and maintain it when the database changes). This is just another handy tool for us as LINQ.&amp;nbsp;Therefore I&amp;#39;ll write about &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;SubSonic&lt;/font&gt; in parallel to the LINQ articles. We can compare LINQ and &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;SubSonic&lt;/font&gt; later on. Since this is the first article about &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;SubSonic&lt;/font&gt; in this forum I&amp;#39;ll start with an introduction.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What is &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;SubSonic&lt;/font&gt;?&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;&lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;SubSonic&lt;/font&gt;, initially named as ActionPack is developed as an open source project by &lt;font color="#cc9900"&gt;&lt;a class="" title="@ Microsoft" href="http://blog.wekeroad.com/" target="_blank"&gt;Rob Conery&lt;/a&gt;&lt;/font&gt; before he joined Microsoft, but who is&amp;nbsp;currently&amp;nbsp;working for Microsoft in the ASP.Net team under &lt;a class="" title="@ Microsoft" href="http://weblogs.asp.net/scottgu/" target="_blank"&gt;Scott Guthrie&lt;/a&gt;. The other team members of this project are &lt;a class="" title="His Blog" href="http://monk.thelonio.us/" target="_blank"&gt;Eric Kemp&lt;/a&gt;, Scott Watermasysk, &lt;a class="" href="http://weblogs.asp.net/jgalloway/default.aspx" target="_blank"&gt;Jon Galloway&lt;/a&gt;, &lt;a class="" title="@ Microsoft" href="http://www.haacked.com/" target="_blank"&gt;Phil Haack&lt;/a&gt;, and &lt;a class="" title="His Blog" href="http://weblogs.asp.net/gavinjoyce/default.aspx" target="_blank"&gt;Gavin Joyce&lt;/a&gt;. This project has got attention from Microsoft&amp;nbsp;even though it is still an open source project.&amp;nbsp;&lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;SubSonic&lt;/font&gt; will be developed on top of ASP.Net and the new MVC framework that Microsoft has given more attention of. (This information is true at the time of writing this article and as per the &lt;a class="" href="http://subsonicproject.com/" target="_blank"&gt;&lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;SubSonic&lt;/font&gt; Project&lt;/a&gt;&amp;nbsp;&amp;amp; &lt;a class="" href="http://blog.wekeroad.com/2007/10/26/microsoft-subsonic-and-me/" target="_blank"&gt;Rob Conery&amp;#39;s comments&lt;/a&gt;)&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;We can download the latest&amp;nbsp;source code &lt;a class="" title="SubSonic Source Code" href="http://subsonicproject.com/" target="_blank"&gt;here&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;&lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;SubSonic&lt;/font&gt; is a toolset that helps a website build itself. It brings some of the fun and elegance of Ruby on Rails to ASP.NET&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;This implements &lt;a class="" href="http://en.wikipedia.org/wiki/Active_record_pattern" target="_blank"&gt;Active Record&lt;/a&gt; design pattern.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Helps us quickly build data driven websites without writing data manipulation code&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Has a DAL generator that enables us to rapidly create strongly typed collections and CRUD (Create, Read, Update and Delete) enabled objects, which represent the selected database tables&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Has an&amp;nbsp;&lt;a class="" href="http://en.wikipedia.org/wiki/Object-relational_mapping" target="_blank"&gt;object relational (OR)&amp;nbsp;mapper&lt;/a&gt; which extends to stored procedures and views&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Could also automatically generate the UI for the data manipulation tasks&amp;nbsp;(scaffolding support). This is very handy when creating the admin panel of a data driven web applications. We don&amp;#39;t need to worry about creating it from scratch&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Has a dynamic query tool that let us use SQL Server, MySQL and Enterprise Library (Application Blocks) without having to know the underlying SQL syntax (Lets go into technical details in the next articles to follow)&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;We&amp;nbsp;just need to give the reference to the &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;SubSonic&lt;/font&gt; DLL and set &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;SubSonic&lt;/font&gt; settings in the Web.config file to make use of the power of &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;SubSonic&lt;/font&gt; (Lets go into technical details in the next articles to follow)&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Saves lot of development time and that is the main objective of creating &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;SubSonic&lt;/font&gt;. Will our bosses give more work for the time we save using SubSonic? &lt;img src="http://dnfug.com/Web/emoticons/emotion-15.gif" alt="Geeked" /&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;SubSonic&lt;/font&gt;&amp;nbsp;is an open source tool set to auto generate data manipulation code and interfaces. This works on top of ASP.Net and the MVC framework. This gives an extension and a cool new addition to the strength of .Net compliance languages and most importantly this SAVES lot of development time.&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&amp;nbsp;&lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;SubSonic&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. IT saves lot of time.&amp;nbsp;It&amp;#39;s 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="" href="http://subsonicproject.com/" target="_blank"&gt;&lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;SubSonic&lt;/font&gt; Project&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="" title="Previous project site" href="http://dnfug.com/Web/blogs/mperera/subsonic_logo.png" target="_blank"&gt;SubSonic at CodePlex&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="http://blog.wekeroad.com/" target="_blank"&gt;Reb Conery&amp;#39;s weblog&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="http://scribesonic.com/Blog/Category/SubSonic.aspx" target="_blank"&gt;ScribeSonic&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="http://johnnycoder.com/blog/2006/11/05/subsonic-another-look-at-code-generation/" target="_blank"&gt;Jonny Coder&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://v900u039rux.maximumasp.com/Web/aggbug.aspx?PostID=131" width="1" height="1"&gt;</description><category domain="http://v900u039rux.maximumasp.com/Web/blogs/mperera/archive/tags/ASP.Net+2.0/default.aspx">ASP.Net 2.0</category><category domain="http://v900u039rux.maximumasp.com/Web/blogs/mperera/archive/tags/ASP.Net+3.5/default.aspx">ASP.Net 3.5</category><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/ASP.Net/default.aspx">ASP.Net</category><category domain="http://v900u039rux.maximumasp.com/Web/blogs/mperera/archive/tags/SubSonic/default.aspx">SubSonic</category></item><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><item><title>Beware with Math.Round() in C#</title><link>http://v900u039rux.maximumasp.com/Web/blogs/mperera/archive/2007/12/26/issue-with-math-round-in-c.aspx</link><pubDate>Wed, 26 Dec 2007 07:44:00 GMT</pubDate><guid isPermaLink="false">3790bee0-d05b-4b84-a272-3ed522a0473a:123</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=123</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://v900u039rux.maximumasp.com/Web/blogs/mperera/commentapi.aspx?PostID=123</wfw:comment><comments>http://v900u039rux.maximumasp.com/Web/blogs/mperera/archive/2007/12/26/issue-with-math-round-in-c.aspx#comments</comments><description>&lt;p&gt;&lt;strong&gt;Problem&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Recently I found an issue with the Math.Round() function in C# while working on an enhancement project written in Visual Studio 2003.&amp;nbsp;I.e. this function is using the Banker&amp;#39;s method.&amp;nbsp;The users of this system didn&amp;#39;t like the way figures are getting rounded&amp;nbsp;and they wanted the method used in Excel (Because they are used to Excel &lt;img src="http://dnfug.com/Web/emoticons/emotion-18.gif" alt="Huh?" /&gt;). I.e. Symmetric Arithmetic Rounding method. E.g&lt;/p&gt;
&lt;p&gt;Say we want to round 1234.50000 into the nearest integer value. Then Math.Round() returns 1234 whereas MS Excel gives 1235.&lt;/p&gt;
&lt;p&gt;I also found&amp;nbsp;a similar&amp;nbsp;issue in SQL Server 2000&amp;nbsp;some time back. It seems that Microsoft&amp;nbsp;uses contradictory methods of rounding in their products (Visual Studio, SQL Server, Visual Basic, Excel etc.)&amp;nbsp;&lt;img src="http://dnfug.com/Web/emoticons/emotion-7.gif" alt="Tongue Tied" /&gt;&lt;/p&gt;
&lt;p&gt;Most of us learnt this banker&amp;#39;s&amp;nbsp;method while schooling. But it seems that there are many other ways of rounding. Click &lt;a class="" title="Rounding methods used in Microsoft products" href="http://support.microsoft.com/kb/196652" target="_blank"&gt;here&lt;/a&gt; to view all methods of rounding and how you can implement custom rounding procedures.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;font color="#0099cc"&gt;Visual Studio 2003&lt;/font&gt;&lt;/em&gt; - If we want to use Symmetric Arithmetic Rounding method we have to write our own function instead of using Math.Round(). See below for a working function found in &lt;a class="" title="Custom rounding algorithm" href="http://www.codersource.net/csharp_math_round.aspx" target="_blank"&gt;CoderSource.Net&lt;/a&gt;.&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;blockquote&gt;
&lt;p&gt;public&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;static&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;double&lt;/font&gt;&lt;font size="2"&gt; roundNum(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;double&lt;/font&gt;&lt;font size="2"&gt; num, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;int&lt;/font&gt;&lt;font size="2"&gt; place)&lt;br /&gt;{ &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;blockquote&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;double&lt;/font&gt;&lt;font size="2"&gt; n; &lt;br /&gt;n = num * Math.Pow(10, place); &lt;br /&gt;n = Math.Sign(n) * Math.Abs(Math.Floor(n + .5)); &lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;return&lt;/font&gt;&lt;font size="2"&gt; n / Math.Pow(10, place); &lt;/font&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;font size="2"&gt;} &lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;em&gt;&lt;font color="#0099cc"&gt;Visual Studio 2005&lt;/font&gt;&lt;/em&gt; - This problem is sorted in this version of Visual Studio.&amp;nbsp;We can now select the rounding method in;&lt;/font&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;
&lt;p&gt;System.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;Math&lt;/font&gt;&lt;font size="2"&gt;.Round&lt;/p&gt;&lt;/font&gt;&lt;/blockquote&gt;&lt;/font&gt;
&lt;p&gt;&lt;strong&gt;Rule Of Thumb&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;u&gt;Always&lt;/u&gt; ask from the users which method of rounding they want during the system requirements gathering stage. This will avoid&amp;nbsp;us being using the default method of rounding in our chosen development language. In this case C#.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="" title="Methods of Rounding" href="http://en.wikipedia.org/wiki/Rounding" target="_blank"&gt;Wikipedia&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="" title="How To Implement Custom Rounding Procedures" href="http://support.microsoft.com/kb/196652" target="_blank"&gt;Microsoft Help and Support&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="" title="Custom rounding algorithm" href="http://www.codersource.net/csharp_math_round.aspx" target="_blank"&gt;CoderSource.Net&lt;/a&gt;&lt;/p&gt;&lt;img src="http://v900u039rux.maximumasp.com/Web/aggbug.aspx?PostID=123" 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/ASP.Net/default.aspx">ASP.Net</category><category domain="http://v900u039rux.maximumasp.com/Web/blogs/mperera/archive/tags/Visual+Studio/default.aspx">Visual Studio</category></item></channel></rss>