473,396 Members | 2,090 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,396 software developers and data experts.

VS 2003, false data concurrency error

Hi

I have a vs 2003 winform data app. All the data access code has been
generated using the data adapter wizard and then pasted into the app. The
problem I have is that I am getting a data concurrency error on
mydataadapter.update() method. I know that there is no data concurrency
problem as I am the only user testing the app. Obviously the error is
misleading. What can I do from here to fix this problem?

Thanks

Regards


Feb 25 '07 #1
3 1403
"I am the only user testing the app" is not a valid indication of what
constitutes concurrency nor will it prevent a concurrency error. In a
nutshell, "concurrency" at the time of update is a requirement that the
original dataource be the same as it was when the initial query was issued.
This can occur with 1-to-infinity users.

What might happen with a single user that causes a concurrency error? The
best example I can think of is where a user updates a row in a datagrid but
does not execute a re-query, then tries to update the same row in the
datagrid again. Well, will the data in the datasource now match the original
query? It most certainly will not, and thus this is why the
Microsoft-generated update logic includes an additional query.

The most reliable and easiest technique to ensure concurrency is to use a
primary key column and timestamp column to compare against for concurrency
and to ensure that those columns you are using to ensure concurrency do in
fact match the original data at the time of update. If not, find out why.

"John" <Jo**@nospam.infovis.co.ukwrote in message
news:uB**************@TK2MSFTNGP02.phx.gbl...
Hi

I have a vs 2003 winform data app. All the data access code has been
generated using the data adapter wizard and then pasted into the app. The
problem I have is that I am getting a data concurrency error on
mydataadapter.update() method. I know that there is no data concurrency
problem as I am the only user testing the app. Obviously the error is
misleading. What can I do from here to fix this problem?

Thanks

Regards


Feb 25 '07 #2
There isn't a second process I can see that is updating the db. I have also
checked that all field sin the backend access db have required=no and Allow
Zero Length=Yes.

Any ideas? Thanks.

Regards

"Earl" <br******@newsgroups.nospamwrote in message
news:ey**************@TK2MSFTNGP03.phx.gbl...
"I am the only user testing the app" is not a valid indication of what
constitutes concurrency nor will it prevent a concurrency error. In a
nutshell, "concurrency" at the time of update is a requirement that the
original dataource be the same as it was when the initial query was
issued. This can occur with 1-to-infinity users.

What might happen with a single user that causes a concurrency error? The
best example I can think of is where a user updates a row in a datagrid
but does not execute a re-query, then tries to update the same row in the
datagrid again. Well, will the data in the datasource now match the
original query? It most certainly will not, and thus this is why the
Microsoft-generated update logic includes an additional query.

The most reliable and easiest technique to ensure concurrency is to use a
primary key column and timestamp column to compare against for concurrency
and to ensure that those columns you are using to ensure concurrency do in
fact match the original data at the time of update. If not, find out why.

"John" <Jo**@nospam.infovis.co.ukwrote in message
news:uB**************@TK2MSFTNGP02.phx.gbl...
>Hi

I have a vs 2003 winform data app. All the data access code has been
generated using the data adapter wizard and then pasted into the app. The
problem I have is that I am getting a data concurrency error on
mydataadapter.update() method. I know that there is no data concurrency
problem as I am the only user testing the app. Obviously the error is
misleading. What can I do from here to fix this problem?

Thanks

Regards



Feb 25 '07 #3

"John" <Jo**@nospam.infovis.co.ukwrote in message
news:uB**************@TK2MSFTNGP02.phx.gbl...
Hi

I have a vs 2003 winform data app. All the data access code has been
generated using the data adapter wizard and then pasted into the app. The
problem I have is that I am getting a data concurrency error on
mydataadapter.update() method. I know that there is no data concurrency
problem as I am the only user testing the app. Obviously the error is
misleading. What can I do from here to fix this problem?

Thanks

Regards
If you are using generated code to do the updates, then it probably looks
for a record with every field matching the original value of the field in
your recordset. Something like this:

update myTable Set field1 = @field1, field2 = @field2
where field1 = @field1_prev, field2 = @field2_prev

....where @field1_prev and @field2_prev are the original values held in the
dataset for those fields (see DataRowViewState, which is maintained for
each row in the dataset).

So if you are changing any of the original values in the database somehow,
it won't find the record, and it will throw a concurrency error.

Hope this helps.
Robin S.
Feb 25 '07 #4

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

Similar topics

3
by: Suzanne | last post by:
Hi All I'm having problems getting my data adapter to throw a concurrency exception with an INSERT command. I want to throw a concurrency exception if an attempt is made to enter a row into...
7
by: Auto | last post by:
I starting to use Visual Studio .NET 2003 creating C# Windows application with SQL Server and I get problem with method Fill() for which when running ends with System Error even with the most...
10
by: Ger | last post by:
I am having problems using VB.Net's Management base object on a machine hosting Windows Server 2003. I am trying to set file permissions from a Windows Service. These files may be loacted on a...
2
by: BobAchgill | last post by:
Do you know why this error might be happening? Maybe it is because I have two data adapters open on the same MDB file?? If this is the problem... how can I keep them from disturbing each other?...
5
by: Mr | last post by:
Hi We have a application with Framework 1.1 and Vs .NET 2003. the application has a service with pooling; like a File system Watcher, but works. the system works fine in the development...
4
by: George | last post by:
Hi all, I am having trouble with updating my data in an Access database. here is my code: Imports System.Data.OleDb Dim AppPath As String = Mid(Application.ExecutablePath, 1,...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.