|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
newbie question: on dataset and dataTable Collectioncan control overwriting changes between the time one gets the row to worked on and the rows one is ready to update the original> or does the merge method and acceptchagnes take care of that automatically? from the built-in help: In a typical multiple-tier implementation, the steps for creating and refreshing a DataSet, and in turn, updating the original data are to: Build and fill each DataTable in a DataSet with data from a data source using a DataAdapter. Change the data in individual DataTable objects by adding, updating, or deleting DataRow objects. Invoke the GetChanges method to create a second DataSet that features only the changes to the data. Call the Update method of the DataAdapter, passing the second DataSet as an argument. Invoke the Merge method to merge the changes from the second DataSet into the first. Invoke the AcceptChanges on the DataSet. Alternatively, invoke RejectChanges to cancel the changes. To give a very broad answer, there are two methods you can look into.
"Optimistic concurrency" or "pessimistic concurrency. Optimistic concurrency is easier to implement and also built into VS2005 - if you have it. If you do, check out this great article: http://www.asp.net/Learn/DataAccess/tutorial21vb.aspx?tabid=63 If you dont have VS 2005 you can still read it and find out how to implement it. Good Luck. Jeff GS wrote: Show quote > any tips to avoid trouble in multi-user environment? specifically how one > can control overwriting changes between the time one gets the row to > worked on and the rows one is ready to update the original> or does the > merge method and acceptchagnes take care of that automatically? > > from the built-in help: > In a typical multiple-tier implementation, the steps for creating and > refreshing a DataSet, and in turn, updating the original data are to: > > Build and fill each DataTable in a DataSet with data from a data source > using a DataAdapter. > > Change the data in individual DataTable objects by adding, updating, or > deleting DataRow objects. > > Invoke the GetChanges method to create a second DataSet that features only > the changes to the data. > > Call the Update method of the DataAdapter, passing the second DataSet as an > argument. > > Invoke the Merge method to merge the changes from the second DataSet into > the first. > > Invoke the AcceptChanges on the DataSet. Alternatively, invoke RejectChanges > to cancel the changes. thx. by VS 2005, are we talking about the pro or team version ? or that
includes VS 2005 express? Would one accomplish the more efficiency with Timestamp vs. a bunch of values for larger user base? under pessimistic condition, timestamp could be too much of an annoyance factor <jeffmag***@gmail.com> wrote in message Show quote news:1157670488.312459.155780@m73g2000cwd.googlegroups.com... > To give a very broad answer, there are two methods you can look into. > "Optimistic concurrency" or "pessimistic concurrency. Optimistic > concurrency is easier to implement and also built into VS2005 - if you > have it. If you do, check out this great article: > > http://www.asp.net/Learn/DataAccess/tutorial21vb.aspx?tabid=63 > > If you dont have VS 2005 you can still read it and find out how to > implement it. > > Good Luck. > > Jeff > > > GS wrote: > > any tips to avoid trouble in multi-user environment? specifically how one > > can control overwriting changes between the time one gets the row to > > worked on and the rows one is ready to update the original> or does the > > merge method and acceptchagnes take care of that automatically? > > > > from the built-in help: > > In a typical multiple-tier implementation, the steps for creating and > > refreshing a DataSet, and in turn, updating the original data are to: > > > > Build and fill each DataTable in a DataSet with data from a data source > > using a DataAdapter. > > > > Change the data in individual DataTable objects by adding, updating, or > > deleting DataRow objects. > > > > Invoke the GetChanges method to create a second DataSet that features only > > the changes to the data. > > > > Call the Update method of the DataAdapter, passing the second DataSet as an > > argument. > > > > Invoke the Merge method to merge the changes from the second DataSet into > > the first. > > > > Invoke the AcceptChanges on the DataSet. Alternatively, invoke RejectChanges > > to cancel the changes. > |
|||||||||||||||||||||||