Home
Forums
New posts
Search forums
Articles
Latest reviews
Search resources
Members
Current visitors
Newsgroups
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Newsgroups
Microsoft DotNet
Microsoft C# .NET
Multiuser database
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Nicholas Paldino [.NET/C# MVP], post: 11559821"] Vanessa, 1. You have to handle that yourself. The DataSet is a disconnected set of data, there is no tie to the underlying database. If someone changes a value in the database, you are responsible for notifying your application of the change. As for whether or not it is correct to do so in the form load, that is up to you, and the semantics of your program. 2. Well, DataSets can't do any updates. They are merely data containers. When you pass the DataSet to a DataAdapter, you set the SelectCommand, InsertCommand, DeleteCommand, and UpdateCommand to command parameters that represent statements (in this case, SQL) or stored procedures which will be called on for every change that was made in the DataSet. 3. Given the nature of the DataSet (disconnected), you are going to want to go with some sort of optimistic concurrency, such as a timestamp, a GUID, or a date. Basically, when you load the record, you make sure this value is loaded as well. Then, when you write the record back, you check to make sure that the value is the same. If it is, then you can change the record, if not, then you know someone else has changed it, and you should abort the operation (and rollback the transaction, if there is one). Of course, after you make the change, you make sure that the timestamp is updated (if it is a guid or date, then you have to do this yourself, timestamp columns should auto-update on change). [/QUOTE]
Verification
Post reply
Home
Forums
Newsgroups
Microsoft DotNet
Microsoft C# .NET
Multiuser database
Top