473,548 Members | 2,636 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1112
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.upd atecommand

"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
1268
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 to return a dataset and send it to the client. now in my service class if I reference the dataset then I also need to attach and send the dataset...
7
318
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, this writes the data such that each DataTable in the dataset is written one after the other. This is not what I need. I do not need to be able to...
2
1806
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 question. But, I'm not proud! :-) I'm using Ado.net and I'm wanting to load a DataSet object with several independent tables. (For those who arent...
3
2373
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 things. The method I am writing queries a large dataset. As part of my feedback to the user, I am updating the status bar when the connection is made...
5
2624
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 bear with me. I am going through the QuickStart. After reading a little, I am trying to implement a simple page on a simple project I have made up....
0
1291
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 dropdown list. Previously i've written a lot of these page's by not using the webcontrols, but now i've reached this magically moment that i want...
6
1277
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 retrieve the data via "Reader"...but how to I update for changes? Thanks
2
4198
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 file (which I can provide if necessary). I use 'Add new Item' and pick 'DataSet'. I believe this creates a TypedDataSet, CORRECT? I take all the...
9
2367
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 rs("firstname"), I can do <%=rs("firstname")%anywhere in the web page. How do we achieve it in asp.net? Sorry for the simple question, but please...
0
7512
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
1
7466
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7803
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6036
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5362
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3495
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1926
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1051
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
751
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.