Optimistic is always better; it scales. You can use the timestamp approach, by having such a field on the underlying table. Before updating a record, you compare your timestamp (the one in the disconnected dataset) with the one in the database table for that record. If they are not equal, it means somebody else changed if before. Then, you can either throw an exception, warn the user he's about to overwrite some other's work, or reload the data and show a conflict resolution UI, or whatever.
Related Q&A from Daniel Cazzulino
Here Daniel Cazzulino explains how to load a DSL (domain specific language) domain model instance file programmatically. This requires the .NET type ...continue reading
Here we offer a glimpse at 12 of .NET development expert Danny Cazzulino's top ASP.NET questions and answers.continue reading
C# developers should NOT be modifying InitializeComponent method in the code-behind (or any of the variable definitions) by hand.continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.