Linq submitchanges not updating database
The first thing to do is to create your file and then drag tables from the Server Explorer onto the design surface.I have something that looks like this: I’m also going to click on blank space in the design surface, go to the Properties window, and set the Serialization Mode to Unidirectional.This will put the [Data Contract] and [Data Member] attributes on the designer-generated entity objects so that they can be used in WCF services.Now I’ll create some web services that look something like this: I have two web service methods — one that loads an Employee by ID and one that saves an Employee.LINQ to SQL is a great tool, but when you’re using it in an n-tier scenario, there are several problems that you have to solve.
The other frequent reason for errors, occurring when submitting changes, is concurrency conflicts.
From the server point of view, such an operation is correct: no actual error occurred, the only thing is that nothing was updated either.
But for the application, the object state not being saved is clearly an error, so Linq Connect throws Change Conflict Exception (the text is usually "Row not found or changed.").
If the same window will be used for the form to update a record and add a record, then the Accept button will be the single button to start the task.
With this in mind, the single button will need to have a condition to understand if the record is new, or if it exists.