LINQ in Action roller

InsertOnSubmit when you have a unique key contraint

have an Table called say Customer ( it has a unique key contraint on Customer Name ) if I do ( with a non unique name ) Using db As New BlogsDataContext() db.Customers.InsertOnSubmit(aCustomer) db.SubmitChanges() End Using If I catch the exception and display a nice message, the user then changes the customer name to something unique, and saves using code above you get. "An attempt has been made to Attach or Add an entity that is not new, perhaps having been loaded from another DataContext. This Read More...
Published Sunday, April 27, 2008 12:55 AM by MSDN Forums: LINQ Project General
Anonymous comments are disabled

Featured Item

This Blog

Sponsoring

Syndication