
Note: Microsoft's Antoine Cote posted the following message on May 18, 2006 in the "Associations in DLinq Designer" thread: "[F]or the CTP, the designer only support[s] single column keys. We're working on supporting composite keys for the next release."
• Deleting rows from bound DataGridView controls manually doesn't persist the deletions to the source tables when you apply the DataContext.SubmitChanges() method. • Code to work around the failure to persist deleted rows throws untrapped NullReferenceExceptions when it encounters the the auto-generated DLinq Designer code's instruction that's emphasized below in the Public Property Customer() As Customer procedure:
If (Not (Me._Customer.Entity) Is Nothing) Then 'Fix for deletions 'Me._Customer.Entity = Nothing (moved below) Me._Customer.Entity.Orders.Remove(Me) Me._Customer.Entity = Nothing End Ifand in the Public Property Order_() As Order_ procedure:
If (Not (Me._Order_.Entity) Is Nothing) Then 'Fix for deletions 'Me._Order_.Entity = Nothing (moved below) Me._Order_.Entity.Order_Details.Remove(Me) Me._Order_.Entity = Nothing End IfThe preceding procedures are auto-generated by the DLinq Designer tool, so it's likely that you'll need to make the changes multiple times. Note: Terry Adams (tadam)—the development lead on the DLinq team—confirms some of these issues in a comment to this post. The article and its sample code, which you download from the "Get the code" link in the Article Tools box on page 1, includes these fixes in the DLinqDataBinding.sln project. This project also demonstrates how to take advantage of the new Optimistic Concurrency Confict Resolution (OCCR) features of the May 2006 CTP of the DLinq bits. Technorati Tags: LINQ, DLinq, C# 3.0, VB 9, Visual Basic 9, Orcas
0 comments:
Post a Comment