472,808 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,808 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 1369
"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,...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.