473,395 Members | 1,348 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Simple Dataset Question

I know datasets have been beaten to death in here, I have what is hopefully
a simple question about the integrity of a dataset when used in an
application.

Scenario:
User A and User B are updating data in a SQL database via an application
that utilizes a dataset, dataadapter and datagrid.

User A retrieves data from data source and sits on the data for some time
User B retrieves SAME data from source, changes data via teh datagrid and
updates the data source using the dataadpter
User A makes changes to the data using the datagrid and then attempts to
update the data source

How smart is the dataset/dataadapter to know that the data was changed by
User B since the last time User A retrieved the data? Will User B's changes
be overwritten by User A's changes?

If so, how does one prevent this or how can the developer notify User A that
the data is no longer accurate based on what they saw in the datagrid?

TIA!
-Rich
Nov 20 '05 #1
2 1100
The dataset/dataadapter in User A will never know that the data was changed by User B because dataset/dataadapter just get a snapshot like a client side cursor. Whether overwrite data changed by User B or refuse data changed by User A depends on how you implement in dataadapter.updatecommand

"Rich Wallace" wrote:
I know datasets have been beaten to death in here, I have what is hopefully
a simple question about the integrity of a dataset when used in an
application.

Scenario:
User A and User B are updating data in a SQL database via an application
that utilizes a dataset, dataadapter and datagrid.

User A retrieves data from data source and sits on the data for some time
User B retrieves SAME data from source, changes data via teh datagrid and
updates the data source using the dataadpter
User A makes changes to the data using the datagrid and then attempts to
update the data source

How smart is the dataset/dataadapter to know that the data was changed by
User B since the last time User A retrieved the data? Will User B's changes
be overwritten by User A's changes?

If so, how does one prevent this or how can the developer notify User A that
the data is no longer accurate based on what they saw in the datagrid?

TIA!
-Rich

Nov 20 '05 #2
Hi Rich,

That is why it is called optimistic concurrency, when this is happening you
have to trap that in the dataadapter update. Have a look for that on MSDN.

Some links to start.

http://msdn.microsoft.com/library/de...rencyerror.asp

http://msdn.microsoft.com/library/de...oncurrency.asp

I hope this helps?

Cor
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Tom | last post by:
hi I have a simple question. I am writing a simple remoting app.. basically I have client/server and a serialised service class.. the problem is I am doing some db work on the server and I want...
7
by: LeROY | last post by:
I need to output some related data tables as XML. I have my data adapters and my dataset with the relations defined. It is certainly simple enough to use the dataset.WriteXML function. However,...
2
by: Simon Harvey | last post by:
Hi everyone, I was wondering if it is possible, to use SQL to return more than one table at a time into a dataset. I only know the basics of SQL and so I'm not sure if I'm just asking a stupid...
3
by: Elliot Rodriguez | last post by:
Hi: I am writing a WinForm app that contains a DataGrid control and a StatusBar control. My goal is to update the status bar using events from a separate class, as well as some other simple...
5
by: Stephanie_Stowe | last post by:
Hi. I am trying to get used to AS.NET. I have been doing ASP classic for years, and am now in a position to do ASP.NET. I am in the stumbling around until I get my bearings phase. I hope you will...
0
by: Pietje puk | last post by:
Hello, Since im quite new to ASP.NET i wanted to ask you folks what the best way is to create a WebForm for modifying 1 field from a record. The manipulation of this field can be done by using...
6
by: Arne Beruldsen | last post by:
I have a very simple Access data base. No new info is going to be added...the only changes are to existing fields. I have 2 tables both with one row each. I'm using vb.net. I can easily...
2
by: dave | last post by:
Hi, I have searched for the answer for this error message without success. I have seen the question many times though:) I create an ASP.NET project (VS 2005, C#), and use a very simple .mdf...
9
by: =?Utf-8?B?S2VsbHk=?= | last post by:
I am from classic asp and learning asp.net. In the past, once I have a recordset retrieved, I can use it wheneve and wherever I want. For example, I know my recordset contains something like...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.