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...