<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.dotnetmafia.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>Corey Roth [MVP] : LINQ to SQL</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/LINQ+to+SQL/default.aspx</link><description>Tags: LINQ to SQL</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 20917.1142)</generator><item><title>My 500th Post! Left Outer Joins with LINQ</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/15/my-500th-post-left-outer-joins-with-linq.aspx</link><pubDate>Wed, 15 Oct 2008 19:43:46 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:743</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.dotnetmafia.com/blogs/dotnettipoftheday/rsscomments.aspx?PostID=743</wfw:commentRss><comments>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/15/my-500th-post-left-outer-joins-with-linq.aspx#comments</comments><description>&lt;p&gt;Today, this blog reaches an important milestone.&amp;nbsp; This is my 500th post.&amp;nbsp; It&amp;#39;s just a number, but I thought I would use it as an opportunity to talk about the history of the blog and where it is heading.&amp;nbsp; On December 1st, 2004, I wrote my first .NET Tip of the Day about a great new method on primitives called &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2004/12/01/tryparse-is-a-good-time.aspx"&gt;TryParse&lt;/a&gt; in the upcoming release of ASP.NET 2.0.&amp;nbsp; This blog started out as a simple announcements list built on a SharePoint intranet site so that I could educate a team of developers on emerging technology (at the time it was .NET 2.0 and SQL Server 2005).&amp;nbsp; When I left that company, I wanted to keep the concept going so I exported all of the content and created a home-grown blogging engine at &lt;a href="http://www.dotnettipoftheday.com"&gt;dotnettipoftheday.com&lt;/a&gt;.&amp;nbsp; Since then, I have been committed to giving back to the community by providing useful information that will help developers do their every day jobs.&amp;nbsp; My blog has always focused on how to do something not to give my opinion on something that I may or may not know anything about.&amp;nbsp; Admittedly, I haven&amp;#39;t been able to keep up with the daily thing of posting (although I did a pretty good job back then), but I still make an effort to post a few things a week.&lt;/p&gt; &lt;p&gt;Sometime in 2007, the term DotNetMafia was coined by the godfather himself &lt;a href="http://www.dotnetmafia.com/blogs/kylekelin/default.aspx"&gt;Kyle Kelin&lt;/a&gt;.&amp;nbsp; Although the original idea for the mafia has evolved, it turned out to be a great way to get blogs from several of us onto one web site, &lt;a href="http://www.dotnetmafia.com/"&gt;dotnetmafia.com&lt;/a&gt;, which ran on DotNetNuke.&amp;nbsp; The site worked ok for us for a while, but it was lacking.&amp;nbsp; Later that year, I imported everything (well almost everything) into a new Community Server site where we are today.&amp;nbsp; In case you haven&amp;#39;t seen the rest of the DotNetMafia bloggers, be sure and check out &lt;a href="http://www.dotnetmafia.com/blogs/anthonykilhoffer/default.aspx"&gt;Tony Kilhoffer&lt;/a&gt;, &lt;a href="http://www.dotnetmafia.com/blogs/jamesashley/default.aspx"&gt;James Ashley&lt;/a&gt;, &lt;a href="http://www.dotnetmafia.com/blogs/coryrobinson/default.aspx"&gt;Cory Robinson&lt;/a&gt;, and &lt;a href="http://www.dotnetmafia.com/blogs/kevin/default.aspx"&gt;Kevin Williams&lt;/a&gt;.&amp;nbsp; They post on a variety of topics (including some outside of .NET).&lt;/p&gt; &lt;p&gt;In nearly 4 years, I have brought you 500 posts.&amp;nbsp; 112 of those posts have been on SharePoint.&amp;nbsp; Obviously you can see that I have shifted focus some.&amp;nbsp; The main reason is I blog about the things I am working with on a daily basis.&amp;nbsp; Right now, that has been SharePoint.&amp;nbsp; Although I still find time to blog about LINQ and other things from time to time.&amp;nbsp; Let&amp;#39;s face it though, the SharePoint community needs all the help it can get.&amp;nbsp; Sites like &lt;a href="http://www.sharepointblogs.com"&gt;SharePointBlogs.com&lt;/a&gt; (which this feed is syndicated too), have made a huge difference in helping people find the right information.&amp;nbsp; This is why I am committed to posting every nuance I find in the product, so that the next SharePoint developer coming along doesn&amp;#39;t have to spend time trying to figure it out.&lt;/p&gt; &lt;p&gt;I am pleased with how the site has grown to date.&amp;nbsp; In four years, we have gone from having a couple of internal users a month, to 200 - 300 unique visitors a day.&amp;nbsp; 65% of that traffic each day comes from search.&amp;nbsp; The rest are from RSS subscriptions, referrals, and my &lt;a&gt;CodePlex project&lt;/a&gt;.&amp;nbsp; For now, I plan to keep the content coming and encourage others to blog too.&amp;nbsp; I am committed to helping the community even more and hope to continue to grow the site and organize meetups.&amp;nbsp; I want to thank all of my friends, all two of my readers, &lt;a href="http://www.jtleigh.com/people/colin/software/CopySourceAsHtml/"&gt;Copy Source as HTML&lt;/a&gt;, and everyone that has left a comment.&amp;nbsp; I really appreciate it.&lt;/p&gt; &lt;p&gt;Enough fluff for now though, let&amp;#39;s get to some content.&amp;nbsp; I am going to step away from SharePoint for today&amp;#39;s post and try to hit a broader audience talking about LINQ.&lt;/p&gt; &lt;h3&gt;Left Outer Joins with LINQ&lt;/h3&gt; &lt;p&gt;The topic I am talking about today is doing left outer joins with LINQ.&amp;nbsp; Doing a join in LINQ is pretty simple, however doing an outer join is a bit more tricky because the way you do it doesn&amp;#39;t follow the way you would think of it using T-SQL.&amp;nbsp; The documentation on LINQ covers how to do this, but it doesn&amp;#39;t do a great job explaining what you are doing and why.&amp;nbsp; For this example let&amp;#39;s say we have two classes &lt;em&gt;Product&lt;/em&gt; and &lt;em&gt;Inventory&lt;/em&gt;.&amp;nbsp; The Product class has the following properties Name, ProductId, and Price.&amp;nbsp; The Inventory class has the properties ProductId and Count.&amp;nbsp; We want to get a list of all products and know how many we have in inventory but unfortunately the Inventory table isn&amp;#39;t complete and it doesn&amp;#39;t have data on all products.&amp;nbsp; We still want the product to return in a query though.&lt;/p&gt; &lt;p&gt;First, for the purpose of example, I populate two lists.&amp;nbsp; This could just as easily come from an XML document or SQL.&amp;nbsp; In this case we have three products and two items containing inventory, but info is missing for one particular product.&lt;/p&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;Product&lt;/span&gt;&amp;gt; productList = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;Product&lt;/span&gt;&amp;gt;();&lt;/p&gt; &lt;p style="margin:0px;"&gt;productList.Add(&lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Product&lt;/span&gt;() { Name = &lt;span style="color:#a31515;"&gt;&amp;quot;Product 1&amp;quot;&lt;/span&gt;, Price = 10.99f, ProductId = 2 });&lt;/p&gt; &lt;p style="margin:0px;"&gt;productList.Add(&lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Product&lt;/span&gt;() { Name = &lt;span style="color:#a31515;"&gt;&amp;quot;Product 2&amp;quot;&lt;/span&gt;, Price = 1.99f, ProductId = 5 });&lt;/p&gt; &lt;p style="margin:0px;"&gt;productList.Add(&lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Product&lt;/span&gt;() { Name = &lt;span style="color:#a31515;"&gt;&amp;quot;Product 3&amp;quot;&lt;/span&gt;, Price = 3.99f, ProductId = 9 });&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;Inventory&lt;/span&gt;&amp;gt; inventoryList = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;Inventory&lt;/span&gt;&amp;gt;();&lt;/p&gt; &lt;p style="margin:0px;"&gt;inventoryList.Add(&lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Inventory&lt;/span&gt;() { ProductId = 2, Count = 54 });&lt;/p&gt; &lt;p style="margin:0px;"&gt;inventoryList.Add(&lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Inventory&lt;/span&gt;() { ProductId = 9, Count = 31 });&lt;/p&gt;&lt;/div&gt; &lt;p&gt;If this was a T-SQL query it would probably look something like this:&lt;/p&gt; &lt;p&gt;&lt;em&gt;SELECT p.Name, i.Count FROM Products p LEFT OUTER JOIN Inventory i ON p.ProductId = i.ProductId&lt;/em&gt;&lt;/p&gt; &lt;p&gt;In LINQ it is going to look a bit different though.&lt;/p&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;var&lt;/span&gt; productInventory = &lt;span style="color:blue;"&gt;from&lt;/span&gt; product &lt;span style="color:blue;"&gt;in&lt;/span&gt; productList&lt;/p&gt; &lt;p style="margin:0px;"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;join&lt;/span&gt; inventory &lt;span style="color:blue;"&gt;in&lt;/span&gt; inventoryList&lt;/p&gt; &lt;p style="margin:0px;"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;on&lt;/span&gt; product.ProductId &lt;span style="color:blue;"&gt;equals&lt;/span&gt; inventory.ProductId &lt;span style="color:blue;"&gt;into&lt;/span&gt; productInventoryGroup&lt;/p&gt; &lt;p style="margin:0px;"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;from&lt;/span&gt; item &lt;span style="color:blue;"&gt;in&lt;/span&gt; productInventoryGroup.DefaultIfEmpty(&lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Inventory&lt;/span&gt;() { ProductId = product.ProductId, Count = 0 })&lt;/p&gt; &lt;p style="margin:0px;"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;select&lt;/span&gt; &lt;span style="color:blue;"&gt;new&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt; &lt;p style="margin:0px;"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name = product.Name,&lt;/p&gt; &lt;p style="margin:0px;"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProductId = product.ProductId,&lt;/p&gt; &lt;p style="margin:0px;"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count = item.Count&lt;/p&gt; &lt;p style="margin:0px;"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/p&gt;&lt;/div&gt; &lt;p&gt;The first thing we do is get a reference to an instance of the class (&lt;em&gt;product&lt;/em&gt;) out of the &lt;em&gt;productList&lt;/em&gt; with the from clause.&amp;nbsp; We then can join that to the &lt;em&gt;inventoryList.&amp;nbsp; &lt;/em&gt;Remember in LINQ, you always have to have a reference to the class itself and not the collection when performing join and where operations, so we also get a reference to an instance of the class (&lt;em&gt;inventory&lt;/em&gt;).&amp;nbsp; Once we have that we can use the on clause to relate the two lists using the &lt;em&gt;ProductId &lt;/em&gt;field.&amp;nbsp; When doing a join you must use the keyword &lt;em&gt;equals&lt;/em&gt; to relate the two collections.&lt;/p&gt; &lt;p&gt;Here is where things really differ from what you may be used to.&amp;nbsp; The first thing that is different is that the result of the join is stored in a new variable using the into clause (in this case &lt;em&gt;productInventoryGroup&lt;/em&gt;).&amp;nbsp; This is because in LINQ you use the &lt;em&gt;DefaultIfEmpty()&lt;/em&gt; method to specify default values to return when there are no matching values on the right side of the join.&amp;nbsp; You can specify no parameter on this method to use the default when it is empty (usually null or 0 for an int), or you can pass a value for it to use.&amp;nbsp; In this case I created a new instance of Inventory and set &lt;em&gt;Count&lt;/em&gt; to 0.&amp;nbsp; You then use another from clause to reference an item from that join.&amp;nbsp; Once you get to this point, it is just a matter of creating a new anonymous type, with product.Name and item.Count as values.&amp;nbsp; Remember, item in this case is of type Inventory and will contain the value from that list or the default if there is no match.&lt;/p&gt; &lt;p&gt;You can then iterate through the result of the join like usual.&lt;/p&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;foreach&lt;/span&gt; (&lt;span style="color:blue;"&gt;var&lt;/span&gt; item &lt;span style="color:blue;"&gt;in&lt;/span&gt; productInventory)&lt;/p&gt; &lt;p style="margin:0px;"&gt;{&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color:blue;"&gt;string&lt;/span&gt;.Format(&lt;span style="color:#a31515;"&gt;&amp;quot;{0}: {1}&amp;lt;br /&amp;gt;&amp;quot;&lt;/span&gt;, item.Name, item.Count));&lt;/p&gt; &lt;p style="margin:0px;"&gt;}&lt;/p&gt;&lt;/div&gt; &lt;p&gt;Which would return the following results.&lt;/p&gt;&lt;pre&gt;Product 1: 54
Product 2: 0
Product 3: 31
&lt;/pre&gt;
&lt;p&gt;It really isn&amp;#39;t that bad, but it&amp;#39;s just different than what you might be used to coming from the T-SQL world.&amp;nbsp; Hopefully, this explanation helps and will be of use to you.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Of course, don&amp;#39;t forget that tomorrow night is the &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/09/24/announcing-the-first-tulsa-sharepint-meetup.aspx"&gt;SharePint meetup&lt;/a&gt; at CrawPappy&amp;#39;s at 6:00pm.&amp;nbsp; Thanks again.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=743" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/LINQ+to+SQL/default.aspx">LINQ to SQL</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/C_2300_+3.0/default.aspx">C# 3.0</category></item><item><title>Updating Data with LINQ to SQL and GridViews when using a View</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/07/updating-data-with-linq-to-sql-and-gridviews-when-using-a-view.aspx</link><pubDate>Tue, 07 Oct 2008 18:27:59 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:728</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.dotnetmafia.com/blogs/dotnettipoftheday/rsscomments.aspx?PostID=728</wfw:commentRss><comments>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/10/07/updating-data-with-linq-to-sql-and-gridviews-when-using-a-view.aspx#comments</comments><description>&lt;p&gt;Look! It&amp;#39;s a post that isn&amp;#39;t about SharePoint!&amp;nbsp; Today, I want to talk about some of the issues I have run into when trying to update data using a GridView when bound to a LinqDataSource.&amp;nbsp; This data source has an &lt;em&gt;EnableUpdate&lt;/em&gt; property, but unfortunately there is more to it than just that.&amp;nbsp; It works pretty well, but there are a few things that you have to do otherwise you will get the following error.&lt;/p&gt; &lt;p&gt;&lt;em&gt;The Entity is not of the correct type.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;In today&amp;#39;s example, I required a stored procedure to do the update because I was updating multiple tables behind the scenes.&amp;nbsp; Although LINQ can do this, the complexity of the update was simpler if I did it via stored procedure.&amp;nbsp; The data I am displaying in my GridView is based off a database view.&amp;nbsp; The first thing to do is drag the View into your LINQ to SQL class.&amp;nbsp; You need to make sure your view includes a primary key.&amp;nbsp; You then need to select the column and mark it as a Primary Key in the LINQ to SQL designer.&amp;nbsp; After you have your view defined, drag the stored procedure for your update into the designer.&amp;nbsp; Then on the properties of your view&amp;#39;s data class, you can set a default method for Insert, Update, and Delete.&amp;nbsp; In this case I am only worrying about Update.&amp;nbsp; If you click on Update, it will bring up a &lt;em&gt;Configure Behavior &lt;/em&gt;window which will allow give you two choices.&amp;nbsp; &lt;em&gt;Use Runtime &lt;/em&gt;will dynamically generate the CRUD logic at runtime.&amp;nbsp; In our case though, we will choose Customize and then pick our stored procedure out of the list.&lt;/p&gt; &lt;p&gt;After you have selected an update method, your LINQ to SQL class is good to go.&amp;nbsp; You are now ready to build your page.&amp;nbsp; Start by dragging a GridView and LinqDataSource onto your page.&amp;nbsp; On your LinqDataSource, set the EnableUpdate property to true.&amp;nbsp; Use the wizard to bind your LINQ to SQL database.&amp;nbsp;&amp;nbsp; Pick the Entity named after your view but when configuring columns be sure and choose all columns (*).&amp;nbsp; If you select individual columns, it populates the &lt;em&gt;Select &lt;/em&gt;property on the LinqDataSource and you will not be able to make updates.&amp;nbsp; At this point, you can bind your GridView to your LinqDataSource.&amp;nbsp; If you have followed all of the steps so far, the Enable Editing option should be available for you to check.&amp;nbsp; Check it and then the last thing you have to do is set the &lt;em&gt;DataKeyNames&lt;/em&gt; property on the GridView.&amp;nbsp; Set it to the name of your primary key and you should be ready to make updates using&amp;nbsp; a GridView.&lt;/p&gt; &lt;p&gt;I always find that I spend more time than I care to setting up GridViews.&amp;nbsp; Hopefully this will help if you ever need to use LINQ to SQL with a GridView.&amp;nbsp; Also don&amp;#39;t forget &lt;a href="http://techfests.com/Tulsa/2008/default.aspx"&gt;Tulsa TechFest&lt;/a&gt; this week where I will be talking about &lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/09/02/speaking-at-tulsa-tech-fest-again.aspx"&gt;Code Access Security in SharePoint&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=728" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/LINQ+to+SQL/default.aspx">LINQ to SQL</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/C_2300_+3.0/default.aspx">C# 3.0</category></item><item><title>How to: Use LINQ to SQL without using the Object Relational Designer</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/03/17/how-to-use-linq-to-sql-without-using-the-object-relational-designer.aspx</link><pubDate>Tue, 18 Mar 2008 00:54:20 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:537</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.dotnetmafia.com/blogs/dotnettipoftheday/rsscomments.aspx?PostID=537</wfw:commentRss><comments>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/03/17/how-to-use-linq-to-sql-without-using-the-object-relational-designer.aspx#comments</comments><description>&lt;p&gt;LINQ to SQL has already proved to be extremely easy to use to create object relational mappings when you have an existing database schema using the Object Relational Designer.&amp;nbsp; This designer is good, but you may not want something that is autogenerating your domain classes.&amp;nbsp; You may want to generate your domain classes yourself.&amp;nbsp; This is actually quite easy and works in a similar manner to other OR/Ms such as ActiveRecord.&amp;nbsp; The thing I like about it is that your domain objects do not have to inherit from some base class that has all of the underlying logic to access the database.&amp;nbsp; Instead you create a custom class separate from your domain objects that inherits from DataContext.&lt;/p&gt; &lt;p&gt;We&amp;#39;ll create a simple example of a products table for an e-Commerce web site.&amp;nbsp; Let&amp;#39;s start by looking at the domain object.&amp;nbsp; Before you create your domain object start by adding a reference to &lt;em&gt;System.Data.Linq&lt;/em&gt; to your class library if it is not already present.&amp;nbsp; You will then need to add a using statement in each domain class for &lt;em&gt;System.Data.Linq.Mapping&lt;/em&gt;.&lt;/p&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;[&lt;span style="color:#2b91af;"&gt;Table&lt;/span&gt;(Name=&lt;span style="color:#a31515;"&gt;&amp;quot;Products&amp;quot;&lt;/span&gt;)]&lt;/p&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Product&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;{&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;span style="color:#2b91af;"&gt;Column&lt;/span&gt;]&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;string&lt;/span&gt; Name;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;span style="color:#2b91af;"&gt;Column&lt;/span&gt;(IsPrimaryKey=&lt;span style="color:blue;"&gt;true&lt;/span&gt;, Name=&lt;span style="color:#a31515;"&gt;&amp;quot;Id&amp;quot;&lt;/span&gt;)]&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;int&lt;/span&gt; ProductId;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;span style="color:#2b91af;"&gt;Column&lt;/span&gt;(Name=&lt;span style="color:#a31515;"&gt;&amp;quot;Price&amp;quot;&lt;/span&gt;)]&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;double&lt;/span&gt; Price;&lt;/p&gt; &lt;p style="margin:0px;"&gt;}&lt;/p&gt;&lt;/div&gt; &lt;p&gt;The first thing you do in your domain class is decorate it with a &lt;strong&gt;Table&lt;/strong&gt; attribute.&amp;nbsp; An optional parameter here specifies the name of the underlying database table.&amp;nbsp; In this case my domain object it Product but my database table is named Products.&amp;nbsp; I then defined three properties representing columns in the table.&amp;nbsp; The &lt;strong&gt;Column&lt;/strong&gt; attribute specifies that the property will have a corresponding column in a database table.&amp;nbsp; The &lt;em&gt;IsPrimaryKey&lt;/em&gt; parameter specifies that the column is a primary key in the database.&amp;nbsp; The &lt;em&gt;Name&lt;/em&gt; parameter here also allows you to specify a different column name in the database.&lt;/p&gt; &lt;p&gt;That is really all that is required to create a domain object.&amp;nbsp; You can define a class for each domain object you want and you can also create relations between them (but I won&amp;#39;t be covering that here today).&amp;nbsp; Once you have your domain object created, you will need to create a DataContext class to actually be able to query your domain objects.&amp;nbsp; This is also pretty simple.&amp;nbsp; You just expose a property with the generic type of Table&amp;lt;&amp;gt; for each one of your domain objects.&amp;nbsp; The name of the property is what you will use with the DataContext when you are querying with LINQ.&lt;/p&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;StoreDataContext&lt;/span&gt; : &lt;span style="color:#2b91af;"&gt;DataContext&lt;/span&gt;&lt;/p&gt; &lt;p style="margin:0px;"&gt;{&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Table&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;Product&lt;/span&gt;&amp;gt; Products;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; StoreDataContext(&lt;span style="color:blue;"&gt;string&lt;/span&gt; connection)&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : &lt;span style="color:blue;"&gt;base&lt;/span&gt;(connection)&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt; &lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt; &lt;p style="margin:0px;"&gt;}&lt;/p&gt;&lt;/div&gt; &lt;p&gt;Now that you have your domain objects written you will need to create the SQL tables that they represent.&amp;nbsp; You can do this manually, or you can have LINQ create the whole database for you.&amp;nbsp; Just create an instance of your DataContext and call the &lt;em&gt;CreateDatabase&lt;/em&gt; method.&amp;nbsp; This method infers the name of the database given the connection string you used.&amp;nbsp; If you did not specify the database, you need to add a &lt;strong&gt;Database&lt;/strong&gt; attribute with the name to your class.&lt;/p&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:#2b91af;"&gt;StoreDataContext&lt;/span&gt; myDataContext = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;StoreDataContext&lt;/span&gt;(myConnectionString);&lt;/p&gt; &lt;p style="margin:0px;"&gt;myDataContext.CreateDatabase();&lt;/p&gt;&lt;/div&gt; &lt;p&gt;Alright, so now your domain objects and database are created, now you just need to query something with it.&lt;/p&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt; &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;var&lt;/span&gt; products = &lt;span style="color:blue;"&gt;from&lt;/span&gt; product &lt;span style="color:blue;"&gt;in&lt;/span&gt; myDataContext.Products&lt;/p&gt; &lt;p style="margin:0px;"&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; &lt;span style="color:blue;"&gt;where&lt;/span&gt; product.Price &amp;gt; 49.99f&lt;/p&gt; &lt;p style="margin:0px;"&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; &lt;span style="color:blue;"&gt;select&lt;/span&gt; product;&lt;/p&gt;&lt;/div&gt; &lt;p&gt;This simple query simply returns any product with a price greater than 49.99.&amp;nbsp; So, LINQ to SQL doesn&amp;#39;t have to be completely domain driven.&amp;nbsp; This gives you a lot of flexibility and makes it easy to add additional things to your domain logic if you want to.&amp;nbsp; The downside to this of course it that, when your database schema changes, your domain object is not going to get updated at the click of a button.&amp;nbsp; If you are building your domain objects in this manner though, this is probably not a concern to you though.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=537" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/LINQ+to+SQL/default.aspx">LINQ to SQL</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/C_2300_+3.0/default.aspx">C# 3.0</category></item><item><title>LINQ to SQL Logging</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/02/21/linq-to-sql-logging.aspx</link><pubDate>Thu, 21 Feb 2008 15:24:41 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:508</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.dotnetmafia.com/blogs/dotnettipoftheday/rsscomments.aspx?PostID=508</wfw:commentRss><comments>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/02/21/linq-to-sql-logging.aspx#comments</comments><description>&lt;p&gt;The other day I was reading Charlie Calvert&amp;#39;s excellent post on &lt;a href="http://blogs.msdn.com/charlie/archive/2007/12/09/deferred-execution.aspx"&gt;LINQ and Deferred Execution&lt;/a&gt; and stumbled upon a logging feature inside LINQ to SQL.&amp;nbsp; By setting the Log property to a TextWriter (in this case Console.Out), LINQ to SQL will log the query and what parameters it sent to the database server.&amp;nbsp; Assign it before you execute your query like this.&lt;/p&gt;&lt;pre&gt;&lt;span style="mso-ansi-language:en;"&gt;&lt;font size="2"&gt;MyDataContext.Log = &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.Out;&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Obviously you don&amp;#39;t have to log to the console, you can log to any text writer.&amp;nbsp; This provides a great way to log what queries are going to the database and helps eliminate the mystery of what queries have been executing in your application.&amp;nbsp; Obviously, you can view these queries in the debugger, but once your application is in production, this is a good solution.&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=508" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/LINQ+to+SQL/default.aspx">LINQ to SQL</category></item><item><title>ReflectionPermission Required for LINQ to SQL under Partial Trust</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/01/28/reflectionpermission-required-for-linq-to-sql-under-partial-trust.aspx</link><pubDate>Mon, 28 Jan 2008 19:45:00 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:460</guid><dc:creator>CoreyRoth</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.dotnetmafia.com/blogs/dotnettipoftheday/rsscomments.aspx?PostID=460</wfw:commentRss><comments>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/01/28/reflectionpermission-required-for-linq-to-sql-under-partial-trust.aspx#comments</comments><description>So by now, I can assume everyone has been listening to me and you are using partial trust in all of your SharePoint environments right?&amp;nbsp; Ok, probably not, but for the two of you in the world that are, this post is for you.&amp;nbsp; If you decide to use LINQ to SQL in any of your development, I have discovered that &lt;strong&gt;ReflectionPermission&lt;/strong&gt; is needed by LINQ to SQL.&amp;nbsp; I don&amp;#39;t know the exact permissions it needs yet, but if you are in a bind to get it to work in your partial trust you can use a line like the following.&amp;nbsp; I try to avoid giving any permission unrestricted access, but until you find out what the underlying class actually needs, it is dificult.&amp;nbsp; To get you by, use a line like this.&lt;font color="#0000ff" size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; 
&lt;p&gt;&amp;lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;IPermission&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;class&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;font size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&lt;/font&gt;&lt;font size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;version&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;font size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;1&lt;/font&gt;&lt;font size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;Unrestricted&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;font size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;true&lt;/font&gt;&lt;font size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; /&amp;gt;&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;Also some more obvious permissions LINQ to SQL will need is &lt;strong&gt;SqlClientPermission&lt;/strong&gt; and probably &lt;strong&gt;ConfigurationPermission&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=460" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/LINQ+to+SQL/default.aspx">LINQ to SQL</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Code+Access+Security/default.aspx">Code Access Security</category></item><item><title>Returning a single object with LINQ to SQL</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/01/17/returning-a-single-object-with-linq-to-sql.aspx</link><pubDate>Thu, 17 Jan 2008 22:42:25 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:14</guid><dc:creator>C-Dog's .NET Tip of the Day</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.dotnetmafia.com/blogs/dotnettipoftheday/rsscomments.aspx?PostID=14</wfw:commentRss><comments>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/01/17/returning-a-single-object-with-linq-to-sql.aspx#comments</comments><description>I have been messing around with LINQ (both with SQL and XML) and am pretty familiar with the query syntax right now, but I wasn&amp;#39;t sure at first how to get a single object. It&amp;#39;s actually pretty simple using a lambda expression. Assume I have a...(&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/01/17/returning-a-single-object-with-linq-to-sql.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=14" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/LINQ+to+SQL/default.aspx">LINQ to SQL</category></item><item><title>LINQ to SQL Under the Covers</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2007/12/12/linq-to-sql-under-the-covers.aspx</link><pubDate>Wed, 12 Dec 2007 23:12:48 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:19</guid><dc:creator>C-Dog's .NET Tip of the Day</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.dotnetmafia.com/blogs/dotnettipoftheday/rsscomments.aspx?PostID=19</wfw:commentRss><comments>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2007/12/12/linq-to-sql-under-the-covers.aspx#comments</comments><description>With the release of the 3.5 extensions to the framework, there has been a lot of talk about LINQ and with it LINQ to SQL. Well I was interested in more how LINQ to SQL actually worked so I decided to take a look at some of the files it generates in the...(&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2007/12/12/linq-to-sql-under-the-covers.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=19" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/LINQ+to+SQL/default.aspx">LINQ to SQL</category></item><item><title>Cowboy Coding a Data Editor with ASP.NET Dynamic Data</title><link>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2007/12/11/cowboy-coding-a-data-editor-with-asp-net-dynamic-data.aspx</link><pubDate>Tue, 11 Dec 2007 15:33:27 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:21</guid><dc:creator>C-Dog's .NET Tip of the Day</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.dotnetmafia.com/blogs/dotnettipoftheday/rsscomments.aspx?PostID=21</wfw:commentRss><comments>http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2007/12/11/cowboy-coding-a-data-editor-with-asp-net-dynamic-data.aspx#comments</comments><description>The ASP.NET 3.5 Extensions Preview came out this week. The biggest feature people are of course talking about is the MVC framework. I won&amp;#39;t be talking about that today since ten thousand other people already are. Today I will be talking about a new...(&lt;a href="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2007/12/11/cowboy-coding-a-data-editor-with-asp-net-dynamic-data.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.dotnetmafia.com/aggbug.aspx?PostID=21" width="1" height="1"&gt;</description><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/LINQ+to+SQL/default.aspx">LINQ to SQL</category><category domain="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/tags/Cutting+Edge/default.aspx">Cutting Edge</category></item></channel></rss>