Tuesday, February 27, 2007

New LINQ to SQL Video from the LINQ Farm

Charlie Calvert has added a 7.5-minute video for LINQ to SQL beginners to the LINQ Farm. The video covers all the essential steps in creating a C# LINQ to SQL console application from the Northwind sample database's Customers and Orders tables using the DLinq Designer.

The video complements Charlie's earlier LINQ Farm: Connecting to a Database with LINQ to SQL post. My LINQ to SQL C# Primer post has links to Charlie's previous LINQ Farm posts and my additions to his Connecting to Northwind article.

The popularity of console apps to demo LINQ to SQL features is undoubtedly due to the KISS (Keep It Simple, Stupid) mandate, but adding a BindingNavigator and two BindingSource and DataGridView pairs to the project involves only a few mouse clicks. It's a good bet that most data-intensive Visual Studio projects that are candidates for LINQ to SQL use at least a few bound controls.

As an example, here's the UI for an early VB .NET LINQ to SQL (then DLinq) demo project with Customers, Orders, and Order Details grids that lets you update or delete rows and then apply the DataContext.SubmitChanges method to update the underlying tables. (Code is required to insert rows.)

(Click here for full-size image.)

In my books and articles, I generally take the time to provide a WinForm with bound DataGridView, text boxes, or code to prove that the LINQ objects I'm demonstrating support CRUD operations. It might take readers a few minutes more to complete the exercise but they also learn the capabilities (and limitations) of the collections they create.

LINQ Farm: One to Many and Joins with LINQ to SQL and Orcas March CTP

Update 2/28/2007: This primer on relationships and joins in the Northwind sample database is intended for relational database and SQL newbies. It just appeared on 2/28/2007 and must have been hibernating since its 2/20/2007 pub date. The source code for Charlie's last three LINQ to SQL posts requires the Orcas February 2007 CTP, "which should be out very soon."

Microsoft released on the morning of February 28, 2007 the Microsoft Pre-release Software Visual Studio Code Name "Orcas" - March Community Technology Preview (CTP). The "Orcas March CTP Available from MSDN" post has details for downloading a self-extracting install or VirtualPC image (VHD).

0 comments: