Thursday, May 15, 2008

LINQ and Entity Framework Posts for 5/14/2008+

Note: This post is updated daily or more frequently, depending on the availability of new articles.

VS 2008 SP1/.NET 3.5 SP1 Beta-Related Posts

An Example of Updating an ADO.NET Data Services SP1 Beta Web Service and Client

My Updating Simple ADO.NET Data Services and Data Service Clients to SP1 Beta post of May 15 2008 details the process of updating a sample ADO.NET Data Services Project (client and server) from the last Astoria CTP and Entity Framework Beta 3 to the current VS 2008 SP1 Beta drop.

Added: 3/15/2008 4:00 PM

Updated ASP.NET Dynamic Data Samples for SP1 Beta

The MSDN Code Gallery's ASP.NET Dynamic Data Preview offers a May 12, 2008 release of the original Dynamic Data Samples. Here's a description of the samples (lightly edited):

  • contains a sample field template that shows how to display and add images from a database.
  • is an advanced example that shows how to display two columns from a database in one column in data bound control.
  • shows how the main control inside of a Dynamic Control can be exposed and in this case used as the AssociatedControlId of a Label control.
  • The contains an example of using the Dynamic Data controls in an existing website. It contains both the old way and the new way of doing this and how much less code the new method uses.
  • just shows an empty web application with a database and a data model. Once run it will display the dynamically created scaffold that Dynamic Data generates.

You can use SP1 Beta's new ASP.NET Routing Engine (System.Web.Routing) with ASP.NET Dynamic Data SP1 Beta.

Added: 3/15/2008 10:50 AM

ASP.NET Dynamic Data SP1 Beta Help File Link

Individual topics are a bit difficult to find in the online help files, so here's the link to ASP.NET Dynamic Data Overview.

Added: 3/15/2008 10:30 AM

David Hayden Continues his ASP.NET Dynamic Data SP1 Beta Series

His March 15, 2008 Dynamic Data Websites - Displaying Tables and Columns using ScaffoldTable and ScaffoldColumn Attributes post shows you how to control scaffolding of specific tables or columns.

Links to earlier posts on ASP.NET Dynamic Data SP1 Beta series are in the "David Hayden Posts Walkthroughs for the ASP.NET EntityDataSource and Dynamic Data Scaffolding" topic of LINQ and Entity Framework Posts for 5/12/2008+

Added: 3/15/2008 10:30 AM

ADO.NET Team: SP1 Beta Breaking Changes to the Entity Framework

The ADO.NET team posted Entity Framework Breaking Changes - Visual Studio 2008 & .NET 3.5 SP1 Beta in the morning of May 14, 2008, but the link from another ADO.NET post was broken until larger in the afternoon. The changes fall into the following categories:

  • Schema Changes( covers CSDL, SSDL and ProviderManifest Xml formats)
  • Object Services Changes
  • Providers
  • Metadata

Ryan Hauert and David DeWinter Find EDM Designer Bugs in SP1 Beta

In his New Entity Framework designer bugs in SP1 beta of May 14, 2008, Ryan Hauert finds the following bug most frustrating:

The Error List window now lists fake errors for all of our subtypes that are children of abstract entities with a message similar to “Entity types B, C, D are mapped to table A without discriminating conditions on all mappings to the table.”

I reported similar, non-fatal "fake errors" from SQL Server Compact 3.5 SP1 data sources that disappeared on building the project in my Upgraded Northwind.sdf File for SSCE v3.5 Available for Download of May 8, 2008 (Updated May 11, 2008).

Ryan reports he found another bug that "relates to result column bindings for mapped sprocs on subtypes." He includes links to the ADO.NET Entity Framework and LINQ to Entities (Pre-release) forum and Microsoft Connect for the two bugs. VS 2008 SP1 Beta has its own forum here.

Danny Simmons Offers Links to SP1 Help Files, FAQ, and Breaking Changes

Danny's A little more about SP1 Beta and the EF post of May 14, 2008 includes links to online help files for:

Neither Danny or I were able to search these files. I tried LiveSearch and Google without success.

He's also upgraded his FAQ to SP1 at Updated Entity Framework FAQ.

Diego Vega Describes How to Add the Missing LinqDataSource to SP1 Beta's Toolbox

His May 14, 2008 Can't find the Entity Data Source? post gives the step-by-step instructions for adding the LinqDataSource component to the Web forms toolbox and, if necessary add the assembly manually.

The ADO.NET Team Admits There's Little New in LINQ to SQL

The What's New in the SP1 Beta for LINQ to SQL? describes these new features:

Across the LINQ to SQL we have made numerous bug fixes, better SQL translation for queries comparing nullable columns in Visual Basic, and support both in the runtime and the designer for SQL Server 2008.

New SQL Server 2008 Support includes:

  • Support for connecting to SQL Server 2008 databases in Server Explorer
  • Drag & drop tables in SQL Server 2008 databases from Server Explorer
  • Support for the following new types: Date, Time, DateTime2, DateTimeOffset, Filestream

Apparently, LINQ to SQL doesn't plan to take advantage of the upgraded DataContractSerializer that can handle EntitySets and EntityRef for associated entities in a entity.

Diego Vega Provides Some History and Explains Why the EntityDataSource Wraps the Data-Bound Entity

Julie Lerman posted Thinking about the EntityDataSource on January 22, 2008 with the goal of preventing issues with the LinqDataSource being repeated in the EntityDataSource. Diego's New EntityDataSource Control for ASP.NET post of May 13, 2008 attempts to answer at least part of Julie's issues.

The EntityDataSource already is raising questions in the forums. In the EntityDataSource: To wrap or not to wrap of the same date, Diego explains the reasons and rules for wrapping entities instead of exposing them directly.

ADO.NET Entity Framework & LINQ to Relational Data MSDN Code Gallery Site Updated

The ADO.NET Team's UPDATED WIKI: Home link points to the location of updated EFExtensions, eSQLBlast and Entity Framework Query Samples, as well as new Entity Framework Lazy Loading and EFMappingHelper releases.

Diego Vega's ADO.NET Entity Framework Query Samples post of May 13, 2008 points to a "release[, which] contains query samples that are compatible with the .NET 3.5 SP1 Beta version of Entity Framework."

Other LINQ and Entity Framework Topics

Mike Taulty Releases a Two Seasons of Silverlight 2 Beta 1 Screencasts

Mike lists the topics of his 50 New Silverlight 2 Beta 1 Screencasts in this May 15, 2008 post. If his segments were a network weekly, he'd have two years (seasons) in the can.

Here are six segments related to data binding, LINQ to XML, and the DataGrid:

  • 13. Simple Data Binding of UI to .NET Classes
  • 14. List Based Data Binding
  • 15. Data Binding UI to .NET Classes with Converters
  • 39. Reading/Writing XML with LINQ to XML
  • 49. Getting Started with the DataGrid
  • 50. Insert, Update, Delete with the DataGrid

You can download a Silverlight 2 app with a clickable listbox of segments. The selected item comes from Microsoft's free Silverlight Streaming service.

Added: 3/15/2008 10:30 AM

LINQ to SharePoint Competitor INQ4SP in the Works

SharePoint developer Agnes Molnar has developed a competitor to Bart De Smet's LINQ to SharePoint implementation. Following are her three posts that describe LINQ4SP:

Bart appears to have abandoned support for LINQ to SharePoint after going to work for Microsoft.

P.S. OBA is an abbreviation of Microsoft Office Business Applications.

Jonathan Aneja Covers LINQ to DataSet's AsEnumerable() Method

Jonathan's post of May 14, 2008, How LINQ to Dataset works in VB (Jonathan Aneja), describes how the VB compiler handles DataTables with the System.Data.DataSetExtensions' AsEnumerable() method.  Using LINQ to Dataset in an .aspx page (Jonathan Aneja) of May 13, 2004 describes why Imports System.Data is required rather than Imports System.Data.DataSetExtensions.

Dan Whalin Solves the Problem with Timestamp Data in GridView Controls

His Working with the GridView and the System.Data.Linq.Binary Type post of May 14. 2008 coerces the timestamp column to the Binary data type to prevent exceptions during serialization. Dan says:

When I tried to get the serialized TimeStamp data back into the RowVersion property of the LINQ to SQL object (which is the Binary type I mentioned earlier) I kept getting a conversion error initially.  I tried several different options such as the Convert class, converting character arrays to byte arrays, etc. but nothing worked at first.  The main problem was that I was trying to convert the data held in key.Values[1] object to a String type and then convert that back to the Binary type.  After playing around with it more I tried the super simple way of converting the data.  I cast the serialized value directly to the Binary type which was much easier than I was expecting.

John Papa's Writing Data Access with Silverlight 2 for O'Reilly

In As it Once Was, I am Writing a Book of May 14, 2008, John Papa announced that he's back to writing books again and expects O'Reilly will publish Data Access with Silverlight 2 in November or December 2008.

LINQ to MPI.NET Is Nearing Release with a Multithreaded Scoping Model

After months of silence, Adam Sobieski 's Update: LINQ for MPI.NET post of May 14, 2008 announces that Phoster Incorporated's LINQ for MPI.NET implementation now has a multithreaded scoping model. The announcement says the new feature:

[S]implifies the utilization of distributed objects which can utilize the calling MPI communicator context while utilizing .NET interfaces such as ICollection. Before developing this multithreaded scoping model, many of the methods of the distributed data objects had a communicator as a first parameter.

For more information about MPI.NET and LINQ to MPI.NET, read the "LINQ to MPI.NET in Development at Phoster Incorporated" topic of Link and Entity Framework Posts for 11/19/2007+.

Derek Whittaker Finds LINQ to XML Three Times Faster than XPath to Find a Unique Value in a 5.25 MB Document

Derek continues his comparisons of LINQ to XML and XPath with these three posts:

In his last post, Derek determines LINQ to XML is three times faster to XPath to find a unique value in a 5.25-MB document. Unfortunately, Derek didn't provide the code he used for the search.

Colin Meek Describes the SP1 Changes in the Updated EF Extensions Library

Colin's Using LINQ Expressions to Generate Dynamic Methods II of May 13, 2008 says:

The EF Extensions library has been updated to work with the beta and includes several public and internal changes. Source code is available at The latest release introduces some performance improvements in the materializer (you can read about the library here). These improvements illustrate another powerful expression pattern.

To improve code clarity, the EF Extensions API encourages you to write:

var products = command.Materialize<Product>(r => new Product {
    ProductID = r.Field<int>("ProductID"),
    Name = r.Field<string>("Name"),

instead of a more complex (but faster) expression. Colin goes on to describe optimizations for the materializer.

Steve Lasker Announces SQL Server Compact 3.5 SP1 Beta Availability and Encryption Options

In his SQL Server Compact 3.5 SP1 Beta available announcement, Steve notes that SSCE 3.5 SP1 Beta is included in VS 2008 SP1 Beta, but the independent version lets VS 2005 users take advantage of the update.

Steve's Security and Encryption for SQL Server Compact describes the use of Encrypting File System and native SSCE password-based encryption to protect confidential data.

Rob Conery Refactors the MVC Storefront's Shopping Cart and Adds an Authorization Feature

His MVC Storefront, Part 10: Shopping Cart Refactoring and Membership post of May 14, 2008 begs for reader feedback.