<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/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>/bill's House O Insomnia&lt;img src="http://www.williamgryan.com/images/originalcuckoo.jpg" alt="Bill Ryan" /&gt; : LINQ</title><link>http://msmvps.com/blogs/williamryan/archive/tags/LINQ/default.aspx</link><description>Tags: LINQ</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Looking for some .NET Developers</title><link>http://msmvps.com/blogs/williamryan/archive/2008/06/06/looking-for-some-net-developers.aspx</link><pubDate>Sat, 07 Jun 2008 02:19:26 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1632527</guid><dc:creator>William</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=1632527</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=1632527</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2008/06/06/looking-for-some-net-developers.aspx#comments</comments><description>&lt;p&gt;A client of mine located in the Aiken/Columbia South Carolina Area has asked me if I had any friends who are .NET Developers and looking for a job. They are looking for at least one Junior Developer, on Mid-Level Developer and several Senior developers.&amp;nbsp; I know these folks quite well and I can vouch for the following:&amp;nbsp; &lt;/p&gt; &lt;ul&gt; &lt;li&gt;They pay extremely well&lt;/li&gt; &lt;li&gt;Generous benefits package&lt;/li&gt; &lt;li&gt;There&amp;#39;s plenty of cool people on their staff&lt;/li&gt; &lt;li&gt;They are growing at an explosive rate so there&amp;#39;s plenty of room for upward mobility. There&amp;#39;s also a very strong focus on learning/teaching and career development.&lt;/li&gt; &lt;li&gt;They are an Agile/SCRUM shop&lt;/li&gt; &lt;li&gt;Currently developing with the following technologies:&lt;/li&gt; &lt;ul&gt; &lt;li&gt; Visual Studio Team System 2008 / .NET 3.5 Framework&lt;/li&gt; &lt;li&gt;Windows Communication Foundation&lt;/li&gt; &lt;li&gt;Windows Presentation Foundation&lt;/li&gt; &lt;li&gt;ASP.NET&lt;/li&gt; &lt;li&gt;LINQ&lt;/li&gt; &lt;li&gt;Silverlight&lt;/li&gt; &lt;li&gt;Windows Mobile 5/ Windows Mobile 6/ .NET Compact Framework&lt;/li&gt; &lt;li&gt;Sql Server 2005 / Sql Server 2008&lt;/li&gt; &lt;li&gt;Windows Installer for XML&lt;/li&gt; &lt;li&gt;Sandcastle&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;p&gt;If you&amp;#39;re in the area and looking for a job... if you know someone who looking for a job.... or if you&amp;#39;re willing to move, please drop me a line using the Contact option on&amp;nbsp; my blog or emailing me directly at &lt;a href="mailto://WilliamRyan@gmail.com"&gt;WilliamRyan@gmail.com&lt;/a&gt; and I&amp;#39;ll put you in contact with them.&amp;nbsp; They are looking to hire folks immediately so I can probably get you an interview within a few days.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Junior Developer:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Ideal candidate will be a recent college graduate with a Computer Science of MIS degree.&amp;nbsp; No experience is necessary for this position. The main soft-skill qualifications for this position are:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;A true love for development&lt;/li&gt; &lt;li&gt;Strong desire to learn&lt;/li&gt; &lt;li&gt;A desire to stand out among one&amp;#39;s peers&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt; The hard-skill qualifications include a good theoretical understanding of at least two of the following:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Object Oriented Design and Analysis&lt;/li&gt; &lt;li&gt;Relational Database theory&lt;/li&gt; &lt;li&gt;Design Patterns&lt;/li&gt; &lt;li&gt;Familiarity with at least two of the following:&amp;nbsp; C, C++, Java, C#, VB.NET&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;This is essentially a dream job for recent college grads b/c the job is being offered &amp;quot;no experience required&amp;quot;.&amp;nbsp; Since they are a SCRUM/Agile shop, you&amp;#39;ll get to work extensively with their Senior and Mid level devs via Pair Programming.&amp;nbsp;&amp;nbsp; You&amp;#39;ll be able to pick&amp;nbsp; an area to specialize in which you will decide on for yourself. Additionally, you&amp;#39;ll be using some of the most sought after Microsoft technologies available.&amp;nbsp; Go to Monster.com or Dice.com and see for yourself how much demand there is for the above technologies and how much those jobs pay.&amp;nbsp; You&amp;#39;ll get to work with these on day 1 and essentially carve out a path for yourself using whichever technologies you like the best.&amp;nbsp; If you want to be a &amp;quot;UI&amp;quot; expert, that&amp;#39;s where you&amp;#39;ll be put. If you want to be a Web Services dev, again, that&amp;#39;s what you can focus on.&amp;nbsp; If you want to be an expert buildmaster who specializes in installers, that&amp;#39;s what you&amp;#39;ll get to do.&amp;nbsp; The company is looking for some excellent candidates and willing to offer a really fun and great paying job with plenty of training and career development available.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Mid-Level Developer:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;The ideal candidate will have a computer science or MIS degree and 1-3 years of development experience.&amp;nbsp; The ideal candidate will have two or more the following abilities:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Solid command of OOP/OOD using C++, C#, Java or VB.NET&lt;/li&gt; &lt;li&gt;Test Driven Design&lt;/li&gt; &lt;li&gt;Service Oriented Architecture&lt;/li&gt; &lt;li&gt;Familiarity with MySql, Sql Server (T-SQL), Oracle (PL/SQL)&lt;/li&gt; &lt;li&gt;Basic understanding of both Winforms and ASP.NET&lt;/li&gt; &lt;li&gt;Basic familiarity with Web Services, MSMQ, Enterprise Services/COM+, .NET Remoting, DCOM, J2EE, Java Beans&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Just like the Junior development positions, these ones will provide a great deal of flexibility to learn and specialize the area of your choice.&amp;nbsp; These are considered &amp;#39;fast track&amp;#39; positions to move into the Senior Developer or Architect roles&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Senior Developer:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;The ideal candidate will be someone with at least 4 years experience.&amp;nbsp; This person will love challenges and love coming up with solutions to problems that other people run from.&amp;nbsp; They will be people that love figuring out how to do things that everyone else said can&amp;#39;t be done.&amp;nbsp; They will be the stereotypical Alpha-Geek, Someone that spends their spare time &lt;a href="http://newtechusa.com/csharp-dotnet-quiz.asp"&gt;answering quiz questions like these&lt;/a&gt;:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;All of the requirements for the Mid-Level Developer as well as several of the following skills:&lt;/li&gt; &lt;ul&gt; &lt;li&gt;Proficiency with T-Sql or PL/SQL.&amp;nbsp; You should be able to write a 5 table join on your own. You should have written several stored procedures that were &amp;gt; 100 lines long.&lt;/li&gt; &lt;li&gt;Strong command of query tuning and ability to easily spot design flaws&lt;/li&gt; &lt;li&gt;Ability to design &amp;#39;real&amp;#39; objects.&amp;nbsp; &lt;/li&gt; &lt;ul&gt; &lt;li&gt;Someone who pays meticulous attention to the scope modifiers of their classes/functions/properties&lt;/li&gt; &lt;li&gt;Someone who understands the problems associated with coupling and strives to avoid it.&lt;/li&gt; &lt;li&gt;Someone who can write and use events in their classes without thinking twice about it.&lt;/li&gt; &lt;li&gt;Someone with a solid understanding of thread safety and thread synchronization&lt;/li&gt; &lt;li&gt;Someone who is comfortable using several different design patterns&lt;/li&gt; &lt;li&gt;Someone who is comfortable implementing several different interfaces in one object, using combinations of interface implementation and inheritance and someone who can use inheritance responsibly&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;Keeps up with technology, reads computer books regularly, has favorite blogs in multiple disciplines and/or blogs themselves, attends or speaks at user&amp;#39;s groups, is active in one or more online forum or newsgroup&lt;/li&gt; &lt;li&gt;Someone who answers &amp;quot;Which is better, C# or VB.NET?&amp;quot; with &amp;quot;Either can be better depending on the circumstances but I&amp;#39;m comfortable writing in either of them&amp;quot; and then &amp;quot;But I&amp;#39;ve been learning F# lately and it&amp;#39;s really been growing on me&amp;quot;&lt;/li&gt; &lt;li&gt;Experience with .NET Remoting, Web Services &amp;amp; Web Services Enhancements, MSMQ, Enterprise Services and/or WCF&lt;/li&gt; &lt;li&gt;Ability to create syntactically correct UML diagrams (meaning they can do more than write the letters &amp;quot;UML&amp;quot; on their resume) and if not, they are willing to learn to do this.&lt;/li&gt; &lt;li&gt;Understands data structures solidly and could easily implement their own HashTable or LinkedList &lt;/li&gt; &lt;li&gt;Someone who&amp;#39;s always looking to come up with a newer, cooler, faster, and more secure way to do implement something&lt;/li&gt; &lt;li&gt;Experienced with either Biztalk server or Sharepoint&lt;/li&gt; &lt;li&gt;Takes pride in their code without falling in love with it or getting all defensive about it.&amp;nbsp; Ability to acknowledge the fact that everyone makes mistakes and can talk about their mistakes/bugs without getting defensive.&lt;/li&gt; &lt;li&gt;Someone who is the first to raise their hand whenever the boss says &amp;quot;I need someone to learn ____________, do I have any volunteers&amp;quot;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;p&gt;Basically, if you love development, love creating new cutting edge solutions all the while making a lot of money and having a lot of fun you definitely should talk to these folks.&amp;nbsp; If you&amp;#39;re interested...... Please drop me a line using the Contact option on&amp;nbsp; my blog or emailing me directly at &lt;a href="mailto://WilliamRyan@gmail.com"&gt;WilliamRyan@gmail.com&lt;/a&gt; and I&amp;#39;ll put you in contact with them.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1632527" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Compact+Framework/default.aspx">Compact Framework</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Data+Access/default.aspx">Data Access</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Web+Services+_2F00_+WSE/default.aspx">Web Services / WSE</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+Basics/default.aspx">.NET Basics</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+General/default.aspx">.NET General</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Coding+Techniques/default.aspx">Coding Techniques</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Misc+Technology/default.aspx">Misc Technology</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Biztalk/default.aspx">Biztalk</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/WPF/default.aspx">WPF</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/WCF/default.aspx">WCF</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+3.0+Framework/default.aspx">.NET 3.0 Framework</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/WIX/default.aspx">WIX</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Sql+Server+Integration+Services/default.aspx">Sql Server Integration Services</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/SSIS/default.aspx">SSIS</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Sql+Server/default.aspx">Sql Server</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Sql+Server+2008/default.aspx">Sql Server 2008</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Sharepoint/default.aspx">Sharepoint</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/LINQ+To+ADO.NET/default.aspx">LINQ To ADO.NET</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+3.5+Framework/default.aspx">.NET 3.5 Framework</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/LINQ+Training/default.aspx">LINQ Training</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/ADO.NET+3.5/default.aspx">ADO.NET 3.5</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/C_2300_+3.5/default.aspx">C# 3.5</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Windows+Mobile/default.aspx">Windows Mobile</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Job+Stuff/default.aspx">Job Stuff</category></item><item><title>LINQ Gotcha</title><link>http://msmvps.com/blogs/williamryan/archive/2008/05/07/linq-gotcha.aspx</link><pubDate>Thu, 08 May 2008 00:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1616777</guid><dc:creator>William</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=1616777</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=1616777</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2008/05/07/linq-gotcha.aspx#comments</comments><description>&lt;p&gt;After a long hiatus, I was trying to figure out something cool or at least interesting to blog about.&amp;nbsp; I was having trouble figuring out what I wanted to write, but then one after another, I got a ton of ideas.&lt;/p&gt;
&lt;p&gt;One thing I wanted to do for my current project was finding out if a specific ConnectionString was present in the &amp;lt;ConnectionStrings&amp;gt; setting of a .config file. This is a big oversimplification but it&amp;#39;s close enough to explain. So I wrote the following:&lt;/p&gt;&lt;code&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt; myVar = from cs in &lt;font color="#339966"&gt;ConfigurationManager&lt;/font&gt;.ConnectionStrings&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;&lt;font color="#0000ff"&gt;select&lt;/font&gt; cs;&lt;/code&gt;&lt;code&gt; 
&lt;p&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;foreach&lt;/font&gt; (&lt;font color="#0000ff"&gt;var&lt;/font&gt; Mine &lt;font color="#0000ff"&gt;in&lt;/font&gt; myVar)&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#339966"&gt;Console&lt;/font&gt;.WriteLine(myVar);&lt;br /&gt;&amp;nbsp;}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I knew the second I tried to write a where clause that there was a problem b/c intellisense wasn&amp;#39;t showing anything I expected. When I tried to display some of the properties in the foreach loop, nothing was visible. I knew something was wrong. So I tried to compile and got the following error:&lt;/p&gt;
&lt;p&gt;&lt;font face="courier new,courier"&gt;Could not find an implementation of the query pattern for source type &amp;#39;System.Configuration.ConnectionStringSettingsCollection&amp;#39;.&amp;nbsp; &amp;#39;Select&amp;#39; not found.&amp;nbsp; Consider explicitly specifying the type of the range variable &amp;#39;cs&amp;#39;.&lt;/font&gt;&amp;nbsp;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Well, that was helpful b/c I knew at least the problem was with the&amp;nbsp; &lt;a href="http://msdn.microsoft.com/en-us/library/bb383978.aspx"&gt;range variable&lt;/a&gt;&amp;nbsp;.&amp;nbsp; I wasn&amp;#39;t sure what type of collection the &lt;a href="http://msdn.microsoft.com/en-us/library/system.configuration.connectionstringssection.connectionstrings(VS.85).aspx"&gt;ConfigurationManager.ConnectionStrings&lt;/a&gt;&amp;nbsp; property was so I decided to look it up just to be sure. (I also just wanted to make sure it was in fact some type of collection or another. I couldn&amp;#39;t imagine that it wouldn&amp;#39;t have been,&amp;nbsp;but just wanted to make sure for purely superstitious reasons)&amp;nbsp;Ok, so it&amp;#39;s a &lt;a href="http://msdn.microsoft.com/en-us/library/system.configuration.connectionstringsettingscollection(VS.85).aspx"&gt;ConnectionStringsSettingsCollection&lt;/a&gt;&amp;nbsp;, nothing surprising there. Digging deeper I saw that &lt;a href="http://msdn.microsoft.com/en-us/library/system.configuration.connectionstringsettingscollection(VS.85).aspx"&gt;ConnectionStringsSettingsCollection&lt;/a&gt;&amp;nbsp;inherits from &lt;a href="http://msdn.microsoft.com/en-us/library/system.configuration.configurationelementcollection.aspx"&gt;ConfigurationElementCollection&lt;/a&gt;&amp;nbsp;. At that point, it all became crystal clear for I saw the following in the class definition:&lt;/p&gt;&lt;code&gt;&lt;pre class="libCScode" id="ctl00_rs1_mainContentContainer_ctl13CSharp"&gt;&lt;span style="COLOR:blue;"&gt;public&lt;/span&gt; abstract &lt;span style="COLOR:blue;"&gt;class&lt;/span&gt; ConfigurationElementCollection : ConfigurationElement, ICollection, 
    IEnumerable&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;Do you see the problem? There&amp;#39;s an &lt;a href="http://msdn.microsoft.com/en-us/library/system.collections.ienumerable.aspx"&gt;IEnumerable&lt;/a&gt;&amp;nbsp;but no &lt;a href="http://msdn.microsoft.com/en-us/library/9eekhta0.aspx"&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;. You see, the collection implements the non-Generic IEnumerable but not the Generic IEnumerable.&amp;nbsp;Hence, a explicit range variable is in order to make this work.&amp;nbsp; I know I know, that&amp;#39;s exactly what the error message recommended, but I didn&amp;#39;t understand why at first and wanted to dig deeper into it. So bascially, here&amp;#39;s what was needed to make it work.&amp;nbsp; Simply use the &lt;a href="http://msdn.microsoft.com/en-us/library/bb341406.aspx"&gt;Cast&amp;lt;T&amp;gt; &lt;/a&gt;&amp;nbsp; extension method on the collection and well, that&amp;#39;s it.&lt;/p&gt;&lt;code&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;ConnectionStringSettingsCollection&lt;/font&gt; cfg = &lt;font color="#339966"&gt;ConfigurationManager&lt;/font&gt;.ConnectionStrings;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;&lt;code&gt;var&lt;/font&gt; myvar = &lt;font color="#0000ff"&gt;from&lt;/font&gt; cs &lt;font color="#0000ff"&gt;in &lt;/font&gt;cfg.Cast&amp;lt;&lt;font color="#339966"&gt;ConnectionStringSettings&lt;/font&gt;&amp;gt;()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;select&lt;/font&gt; cs;&lt;br /&gt;&lt;font color="#0000ff"&gt;foreach&lt;/font&gt; (var mine &lt;font color="#0000ff"&gt;in&lt;/font&gt; myvar)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;font color="#339966"&gt;&amp;nbsp;Console&lt;/font&gt;.WriteLine(mine);&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Of course, you could just cut out some of the bloat and address the collection directly&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt; myvar = &lt;font color="#0000ff"&gt;from&lt;/font&gt; cs &lt;font color="#0000ff"&gt;in&lt;/font&gt; &lt;font color="#339966"&gt;ConfigurationManager&lt;/font&gt;.ConnectionStrings.Cast&amp;lt;&lt;font color="#339966"&gt;ConnectionStringSettings&lt;/font&gt;&amp;gt;()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;select&lt;/font&gt; cs;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;font color="#0000ff"&gt;foreach&lt;/font&gt; (&lt;font color="#0000ff"&gt;var&lt;/font&gt; mine &lt;font color="#0000ff"&gt;in&lt;/font&gt; myvar)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;Console.WriteLine(mine);&lt;br /&gt;}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Whenever Intellisense doesn&amp;#39;t do what you&amp;#39;re expecting it to, that&amp;#39;s the first tipoff something is wrong in your query.&amp;nbsp; Although my days of 2 day work weeks have come to an end temporarily, I&amp;#39;ll try to find some time to blog the rest of what I was working on - there&amp;#39;s so much you can do with LINQ that I often overlook.&amp;nbsp; And this is the first time I&amp;#39;ve come across the explicit range variable issue but I&amp;#39;m guessing it&amp;#39;ll come up again, particularly if you use LINQ regularly.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1616777" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Range+Variable/default.aspx">Range Variable</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Explicit+Range+Variable/default.aspx">Explicit Range Variable</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/C_2300_+3.5/default.aspx">C# 3.5</category></item><item><title>The Microsoft® Windows Mobile Line of Business Solution Accelerator 2008!</title><link>http://msmvps.com/blogs/williamryan/archive/2008/03/17/the-microsoft-174-windows-mobile-line-of-business-solution-accelerator-2008.aspx</link><pubDate>Mon, 17 Mar 2008 13:04:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1545998</guid><dc:creator>William</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=1545998</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=1545998</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2008/03/17/the-microsoft-174-windows-mobile-line-of-business-solution-accelerator-2008.aspx#comments</comments><description>&lt;p&gt;Rob Tiffany &lt;a href="http://blogs.msdn.com/robtiffany/archive/2008/03/15/a-great-spartan-once-said.aspx"&gt;has got the details...&lt;/a&gt;&amp;nbsp;.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The main features include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;Intelligent resolution awareness&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Synchronization Services&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Windows Communication Foundations &amp;quot;Store and Forward&amp;quot;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;MapPoint&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;LINQ&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Custom Controls&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Managed Stored Procedures and Triggers&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Notifications and Online Help&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Language Switching and Localization&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Some of these (WCF, Synchronization Services) are a lot more thrilling than others but all in all it&amp;#39;s a great step forward.&amp;nbsp; With that said, I think MS really needs to work on a few things. When the iPhones first came out, I was lucky enough to have one sent to me.&amp;nbsp; I liked it but didn&amp;#39;t go gaga over it. After two days, I decided to sell it.&amp;nbsp; I think UI wise, it was far ahead of a typical SmartPhone although the PocketPC edition phones gave it a lot better run for the money.&amp;nbsp; But I know that my opinion is not typical. In fact, most iPhone users who have used or use Windows Mobile are really adamant about the superiority of the UI and usability.&amp;nbsp; I think some of that is b/c they are comparing a 500.00 phone with a much cheaper one in many cases but across the board, the iPhone does probably have the advantage.&amp;nbsp; Having started to toy with the iPhone SDK, I have to admit it&amp;#39;s fairly easy to pick up (nowhere near as easy as the Compact Framework) so once more applications come out for it, it will make it all the more attractive to mainstream users.&amp;nbsp; I have a lot of faith in Microsoft though and nothing would please me more than for Windows Mobile 7.0 to work so well that &lt;a href="http://blah.winsmarts.com/"&gt;my obnoxious iPhone owning friends&lt;/a&gt; will have to pipe down about the greatness of the iPhone.&amp;nbsp; The accelerator however, is definitely a step in the right direction.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1545998" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/News/default.aspx">News</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Humor/default.aspx">Humor</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Data+Access/default.aspx">Data Access</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Misc+Technology/default.aspx">Misc Technology</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/WCF/default.aspx">WCF</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/ADO.NET+Synchronization+Services/default.aspx">ADO.NET Synchronization Services</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Microsoft.Synchronization/default.aspx">Microsoft.Synchronization</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Mobility/default.aspx">Mobility</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/Sahil+Malik/default.aspx">Sahil Malik</category></item><item><title>Off to Stockholm this week</title><link>http://msmvps.com/blogs/williamryan/archive/2008/02/10/off-to-stockholm-this-week.aspx</link><pubDate>Mon, 11 Feb 2008 00:17:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1507259</guid><dc:creator>William</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=1507259</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=1507259</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2008/02/10/off-to-stockholm-this-week.aspx#comments</comments><description>&lt;p&gt;This Friday (2/15), I&amp;#39;m flying out of Atlanta en route to Stockholm, Sweden. I&amp;#39;ll be there from the 16th-24th to do a training course on ADO.NET 3.5.&amp;nbsp; My plane has a slight layover in Amsterdam but not long enough to do anything.&amp;nbsp; I will however have a few free days and&amp;nbsp; might head over to that Dutch city with an S that I can&amp;#39;t pronounce where Frans lives to go bug him for a while.&amp;nbsp; If you&amp;#39;ll be around, drop me a line and maybe we can meet up.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;And... if you are looking for anyone to do some ADO.NET 3.5 /LINQ/C# 3.0/Entity Framework training, feel free to drop me a line and we can discuss.&amp;nbsp; I&amp;#39;m pretty busy with my 9-5 job but we can probably work something out with a little notice.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1507259" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/LINQ+Training/default.aspx">LINQ Training</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/ADO.NET+3.5/default.aspx">ADO.NET 3.5</category></item><item><title>http://www.thinqlinq.com/ is now up and running</title><link>http://msmvps.com/blogs/williamryan/archive/2008/01/12/http-www-thinqlinq-com-is-now-up-and-running.aspx</link><pubDate>Sat, 12 Jan 2008 19:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1459086</guid><dc:creator>William</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=1459086</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=1459086</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2008/01/12/http-www-thinqlinq-com-is-now-up-and-running.aspx#comments</comments><description>&lt;p&gt;Jim Wooley recently put up &lt;a href="http://www.thinqlinq.com/"&gt;thinqlinq&lt;/a&gt;&amp;nbsp;for fellow Linq enthusiasts out there.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1459086" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/LINQ/default.aspx">LINQ</category></item><item><title>Dabbling in LINQ to ADO.NET</title><link>http://msmvps.com/blogs/williamryan/archive/2008/01/05/dabbling-in-linq-to-ado-net.aspx</link><pubDate>Sun, 06 Jan 2008 02:13:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1439881</guid><dc:creator>William</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/rsscomments.aspx?PostID=1439881</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/williamryan/commentapi.aspx?PostID=1439881</wfw:comment><comments>http://msmvps.com/blogs/williamryan/archive/2008/01/05/dabbling-in-linq-to-ado-net.aspx#comments</comments><description>&lt;p&gt;I&amp;#39;ll be doing a training seminar in Stockholm next month and I&amp;#39;ve been trying to create some compelling examples to illustrate various concepts.&amp;nbsp; Although it&amp;#39;s keeping me busy, there&amp;#39;s&amp;nbsp;a&amp;nbsp; lot I&amp;#39;ve been working on that&amp;#39;s blogworthy.&lt;/p&gt;
&lt;p&gt;One concept in LINQ to SQL that&amp;#39;s I am pretty fond of is the use of Entities. There&amp;#39;s so much you can do with Entities that it would take quite a few posts to do them justice, but I&amp;#39;ll show a simple example of how they can be used.&amp;nbsp; Assuming we&amp;#39;re using SQL Server 2005 for this example, I have a database table with the following table definition:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;GO &lt;font color="#339966"&gt;/****** Object: Table [dbo].[Bank] Script Date: 01/05/2008 21:14:48 ******/&lt;/font&gt; &lt;br /&gt;&lt;font color="#0000ff"&gt;SET ANSI_NULLS ON&lt;/font&gt; &lt;br /&gt;GO&lt;br /&gt;&lt;font color="#0000ff"&gt;SET QUOTED_IDENTIFIER ON &lt;/font&gt;&lt;/code&gt;&lt;code&gt;&lt;font color="#0000ff"&gt;GO SET ANSI_PADDING ON&lt;/font&gt; &lt;br /&gt;GO&lt;br /&gt;&lt;font color="#0000ff"&gt;CREATE TABLE&lt;/font&gt; [dbo].[Bank](&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; [BankID] [int] &lt;font color="#0000ff"&gt;IDENTITY&lt;/font&gt;(1,1) NOT 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;&amp;nbsp; [Name] [varchar](150) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,&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;[URL] [varchar](50) &lt;font color="#0000ff"&gt;COLLATE&lt;/font&gt; SQL_Latin1_General_CP1_CI_AS 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;&amp;nbsp; [bigLogo] [varchar](50) &lt;font color="#0000ff"&gt;COLLATE&lt;/font&gt; SQL_Latin1_General_CP1_CI_AS 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;&amp;nbsp; [smallogo] [varchar](50) &lt;font color="#0000ff"&gt;COLLATE&lt;/font&gt; SQL_Latin1_General_CP1_CI_AS NULL, &lt;br /&gt;&lt;font color="#0000ff"&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; CONSTRAINT&lt;/font&gt; [PK_Bank] &lt;font color="#0000ff"&gt;PRIMARY KEY CLUSTERED&lt;/font&gt; (&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [BankID] ASC&amp;nbsp;)&lt;br /&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WITH&lt;/font&gt; (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = &lt;font color="#0000ff"&gt;OFF&lt;/font&gt;, IGNORE_DUP_KEY =&lt;font color="#0000ff"&gt;&amp;nbsp;OFF&lt;br /&gt;&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) &lt;br /&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON [PRIMARY] )&lt;br /&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON &lt;/font&gt;[PRIMARY] &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GO&lt;br /&gt;&lt;font color="#0000ff"&gt;SET ANSI_PADDING OFF&lt;/font&gt; &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;So the first thing we need to do is create a class with the same definition (note, if you are using a member name that&amp;#39;s the same as the column name in the db, no additional steps need taken. If you use different names, then you need to specify a Name value .&amp;nbsp; Field names are not case sensitive [meaning as long as they have the same spelling as the field in the db, the capitalization can be different]). So you use [Column(Name=&amp;quot;DBColumnName&amp;quot;)] public Type AliasNameYouWantToUse&lt;/p&gt;&lt;code&gt;&lt;font color="#0000ff"&gt;using&lt;/font&gt; System.Linq;&lt;br /&gt;&lt;font color="#0000ff"&gt;using&lt;/font&gt; System.Linq.Expressions; &lt;br /&gt;&lt;font color="#0000ff"&gt;using&lt;/font&gt; System.Data.Linq.Mapping;&lt;br /&gt;&lt;font color="#0000ff"&gt;namespace&lt;/font&gt; Ryan.Samples.Linq.ADONET {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;font color="#33cccc"&gt;Table&lt;/font&gt;(Name=&lt;font color="#993366"&gt;&amp;quot;Bank&amp;quot;&lt;/font&gt;)] &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;public&lt;/font&gt; class &lt;font color="#33cccc"&gt;Bank&lt;/font&gt; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;font color="#33cccc"&gt;Column&lt;/font&gt;]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;public&lt;/font&gt; Int32 BankID;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;font color="#33cccc"&gt;Column&lt;/font&gt;]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;public&lt;/font&gt; String Name; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;font color="#33cccc"&gt;Column&lt;/font&gt;] &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;public&lt;/font&gt; String URL;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;font color="#33cccc"&gt;Column&lt;/font&gt;] &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;public&lt;/font&gt; String biglogo;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;font color="#33cccc"&gt;Column&lt;/font&gt;]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;public&lt;/font&gt; String smallogo;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;} &lt;/code&gt;
&lt;p&gt;Now, we have a Bank class which corresponds to the Bank table in the database.&amp;nbsp; For this sample, I created a static class with a static property named Globals and ConnectionString respectively.&amp;nbsp; Now, I compose a quick LINQ query to retrieve all of the data in the table except records where the Bank&amp;#39;s Name is PNC:&lt;/p&gt;&lt;code&gt;&lt;font color="#3366ff"&gt;static&lt;/font&gt; &lt;font color="#3366ff"&gt;void&lt;/font&gt; Main(&lt;font color="#3366ff"&gt;string&lt;/font&gt;[] args)&lt;br /&gt;{&lt;br /&gt;&lt;font color="#33cccc"&gt;&amp;nbsp;&amp;nbsp; DataContext&lt;/font&gt; db = new &lt;font color="#33cccc"&gt;DataContext&lt;/font&gt;(&lt;font color="#33cccc"&gt;Globals&lt;/font&gt;.ConnectionString);&lt;br /&gt;&lt;font color="#33cccc"&gt;&amp;nbsp;&amp;nbsp; Table&lt;/font&gt; &amp;lt;&lt;font color="#33cccc"&gt;Banks&lt;/font&gt;&amp;gt; = db.GetTable&amp;lt;&lt;font color="#33cccc"&gt;Bank&lt;/font&gt;&amp;gt;();&lt;br /&gt;&lt;br /&gt;&lt;font color="#3366ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var&lt;/font&gt; query =&lt;br /&gt;&lt;font color="#3366ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&lt;/font&gt; b &lt;font color="#3366ff"&gt;in&lt;/font&gt; Banks&lt;br /&gt;&lt;font color="#3366ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where&lt;/font&gt; b.Name != &lt;font color="#993366"&gt;&amp;quot;PNC&amp;quot;&lt;/font&gt;&lt;br /&gt;&lt;font color="#3366ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;select&lt;/font&gt; &lt;font color="#3366ff"&gt;new&lt;/font&gt; { b.BankID, b.Name, b.URL };&lt;br /&gt;&lt;br /&gt;&lt;font color="#3366ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach&lt;/font&gt; (&lt;font color="#3366ff"&gt;var&lt;/font&gt; row &lt;font color="#3366ff"&gt;in&lt;/font&gt; query)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;font color="#33cccc"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console&lt;/font&gt;.WriteLine(row);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;font color="#33cccc"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console&lt;/font&gt;.ReadLine();&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;
&lt;p&gt;The syntax is pretty straightforward on the LINQ side so it doesn&amp;#39;t really need explaining - if you can&amp;#39;t tell what it&amp;#39;s doing though, it&amp;#39;s selecting each value that doesn&amp;#39; t have &amp;#39;PNC&amp;#39; as a name.&amp;nbsp; The Select statement is using a new C# language feature known as Anonymous types meaning that, a new type is being created without a traditional definition - that&amp;#39;s why the new keyword is used.&lt;/p&gt;
&lt;p&gt;When I first learned LINQ though, I wondered how this worked.&amp;nbsp; Was the whole table retrieved from the database and then records restricted via LINQ?&amp;nbsp; If so, this would seem very wasteful b/c by virtue of the restriction, you know you&amp;#39;re only using a subset of the total values so why pull down everything?&amp;nbsp; Fortunately that&amp;#39;s not what happens.&amp;nbsp; GetTable doesn&amp;#39;t acttually pull down everything from the table - it&amp;#39;s merely an instruction about how to generate the query it will use. As you probably have noticed, nowhere in here have we defined anything reminiscent of the CommandText property you&amp;#39;d use with a IDBCommand object.&amp;nbsp; To prove that you aren&amp;#39;t pulling down a whole table as you might with the old TableDirect instruction, run profiler before this code block executes.&amp;nbsp; The results will show the following (assuming you are logging the same values).&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s the resulting output:&lt;/p&gt;
&lt;p&gt;&lt;font color="#ff0000"&gt;exec sp_executesql N&amp;#39;SELECT [t0].[BankID], [t0].[Name], [t0].[URL]&lt;br /&gt;FROM [Bank] AS [t0]&lt;br /&gt;WHERE [t0].[Name] &amp;lt;&amp;gt; @p0&amp;#39;,N&amp;#39;@p0 nvarchar(3)&amp;#39;,@p0=N&amp;#39;PNC&amp;#39;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;And just for the record, nothing before this ran a query on this table let alone one without a restriction.&amp;nbsp; The output for running this code is shown below:&lt;/p&gt;&lt;font size="1"&gt;
&lt;p&gt;{ BankID = 1, Name = Bank of America, URL = www.bankofamerica.com }&lt;/p&gt;
&lt;p&gt;{ BankID = 2, Name = Citi Bank, URL = www.citibank.com }&lt;/p&gt;
&lt;p&gt;{ BankID = 3, Name = 1st Tennessee, URL = http://www.firsttennessee.com/ }&lt;/p&gt;
&lt;p&gt;{ BankID = 4, Name = Citi Group, URL = www.citigroup.com }&lt;/p&gt;
&lt;p&gt;{ BankID = 5, Name = JP Morgan, URL = www.jpmorgan.com }&lt;/p&gt;
&lt;p&gt;{ BankID = 7, Name = UMB, URL = www.umb.com }&lt;/p&gt;
&lt;p&gt;{ BankID = 8, Name = US Bank, URL = www.usbank.co }&lt;/p&gt;
&lt;p&gt;{ BankID = 9, Name = BMO Financial Group, URL = www4.bmo.com/ }&lt;/p&gt;
&lt;p&gt;{ BankID = 10, Name = M &amp;amp; T, URL = http://www.mandtbank.com/ }&lt;/p&gt;
&lt;p&gt;{ BankID = 11, Name = National City, URL = http://www.nationalcity.com }&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;This brings up one other point... I could have changed the Console.WriteLine to just write out one or more of the properties of &amp;#39;row&amp;#39;.&amp;nbsp; In general, I make a rule of *always* overriding the ToString() method in any object I create just so that I can use it for meaningful information. With LINQ in particular, this becomes particularly useful b/c had I not used an anonymous type, (so the last line would read &amp;#39;select b;&amp;#39; instead of &amp;#39;select new {b.BankID, b.Name, b.URL}; I would have had the following useless output:&lt;/p&gt;&lt;font size="1"&gt;
&lt;p&gt;Ryan.Samples.Linq.ADONET.Bank&lt;/p&gt;
&lt;p&gt;Ryan.Samples.Linq.ADONET.Bank&lt;/p&gt;
&lt;p&gt;Ryan.Samples.Linq.ADONET.Bank&lt;/p&gt;
&lt;p&gt;Ryan.Samples.Linq.ADONET.Bank&lt;/p&gt;
&lt;p&gt;Ryan.Samples.Linq.ADONET.Bank&lt;/p&gt;
&lt;p&gt;Ryan.Samples.Linq.ADONET.Bank&lt;/p&gt;
&lt;p&gt;Ryan.Samples.Linq.ADONET.Bank&lt;/p&gt;
&lt;p&gt;Ryan.Samples.Linq.ADONET.Bank&lt;/p&gt;
&lt;p&gt;Ryan.Samples.Linq.ADONET.Bank&lt;/p&gt;
&lt;p&gt;Ryan.Samples.Linq.ADONET.Bank&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;&amp;nbsp;I could get around that by formatting the output in the Console.WriteLine method but that&amp;#39;s might inelegant. Instead, by overriding the ToString() method, I can get the following output instead:&lt;/p&gt;
&lt;p&gt;&amp;lt;I&amp;#39;&amp;#39;ve truncated several records just for the sake of readability&amp;gt;&lt;/p&gt;&lt;font size="1"&gt;
&lt;p&gt;BankID - 1&lt;/p&gt;
&lt;p&gt;Name - Bank of America&lt;/p&gt;
&lt;p&gt;URL - www.bankofamerica.com&lt;/p&gt;
&lt;p&gt;biglogo - baclogo.jpg&lt;/p&gt;
&lt;p&gt;smallogo - bigbanksmall.jpg&lt;/p&gt;
&lt;p&gt;BankID - 2&lt;/p&gt;
&lt;p&gt;Name - Citi Bank&lt;/p&gt;
&lt;p&gt;URL - www.citibank.com&lt;/p&gt;
&lt;p&gt;biglogo - citibanklogo.jpg&lt;/p&gt;
&lt;p&gt;smallogo - bigbanksmall.jpg&lt;/p&gt;
&lt;p&gt;BankID - 3&lt;/p&gt;
&lt;p&gt;Name - 1st Tennessee&lt;/p&gt;
&lt;p&gt;URL - http://www.firsttennessee.com/&lt;/p&gt;
&lt;p&gt;biglogo - 1sttennlogo.jpg&lt;/p&gt;
&lt;p&gt;smallogo - 1sttennsmall.jpg&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Needless to say, this is a lot more useful than simply knowing the fully qualified object name.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1439881" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/williamryan/archive/tags/LINQ+To+ADO.NET/default.aspx">LINQ To ADO.NET</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/.NET+3.5+Framework/default.aspx">.NET 3.5 Framework</category><category domain="http://msmvps.com/blogs/williamryan/archive/tags/LINQ/default.aspx">LINQ</category></item></channel></rss>