473,385 Members | 1,429 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,385 software developers and data experts.

Strange concurrency error

Hi

I have a perfectly working vs 2003 winform data app. All the data access
code has been generated using the data adapter wizard and then pasted into
the app.

I had to add a new field in the backend access db which I did. I then
dragged the table to the dataset and deleted the old table from the dataset
it so the dataset can see the new field as well.

The problem is that when in update command code I add these two lines

Me.updcomCompanies.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Web_Enabled",
System.Data.OleDb.OleDbType.Boolean, 2, "Web_Enabled"))

and

Me.updcomCompanies.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Web_Ena bled",
System.Data.OleDb.OleDbType.Boolean, 2,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"Web_Enabled", System.Data.DataRowVersion.Original, Nothing))

I startgetting 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
1 1213
Hi,

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

I have a perfectly working vs 2003 winform data app. All the data access
code has been generated using the data adapter wizard and then pasted into
the app.

I had to add a new field in the backend access db which I did. I then
dragged the table to the dataset and deleted the old table from the
dataset it so the dataset can see the new field as well.

The problem is that when in update command code I add these two lines

Me.updcomCompanies.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Web_Enabled",
System.Data.OleDb.OleDbType.Boolean, 2, "Web_Enabled"))

and

Me.updcomCompanies.Parameters.Add(New
System.Data.OleDb.OleDbParameter("Original_Web_Ena bled",
System.Data.OleDb.OleDbType.Boolean, 2,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "Web_Enabled", System.Data.DataRowVersion.Original, Nothing))
You say added these lines, not sure if they came from the wizard too, but
why didn't you configurated the DataAdapter again and copy-pasted it _all_,
just to be sure ?

False concurrency violations aren't always easy to fix definately not
without seeing full code and maybe the db unless it's simple. There are
many reasons that can cause it:
- calling AcceptChanges at the wrong time
- not filling all the columns
- not retrieving auto-generated keys (this can be easily spot, because it
occurs after insert-update-change-update)
- other key problems
....

You could add an eventhandler to DataAdapter.RowUpdating, check for
e.StatementType is Update and then check e.Command, print out the sql text
and all parameter(+values), the old values must be the same as they are in
the DB and check if the key is correct.

You haven't really said when they occur, simple change-update or delete too,
sometimes or always,etc... ?

HTH,
Greetings

I startgetting 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

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

Similar topics

2
by: xAvailx | last post by:
I have a requirement that requires detection of rows deleted/updated by other processes. My business objects call stored procedures to create, read, update, delete data in a SQL Server 2000 data...
4
by: Eric E | last post by:
Hi all, I have a fairly complex form in Access 2000. In particular, it has two subforms on separate tabs of a tab control. For the last two weeks, I've encountered the dreaded : "You can't...
4
by: Robert Schuldenfrei | last post by:
Dear NG, I was about to "improve" concurrency checking with a Timestamp when I discovered that my current code is not working. After about a day of beating my head against the wall, I am...
8
by: Mike Kelly | last post by:
I've chosen to implement the "optimistic concurrency" model in my application. To assist in that, I've added a ROWVERSION (TIMESTAMP) column to my main tables. I read the value of the column in my...
4
by: Jerry | last post by:
Hi, I have an app which retrieves data from a sql server table and displays it on a datagrid. If 2 sessions of this app are running and 2 users try to update the same record at about the same...
6
by: WSobczuk | last post by:
I have encountered a very strange error and I'm hoping that some Python hackers here could give me insight on this. searchview.py file contains two functions: def mysearch(indexname, request, c,...
4
by: Bob | last post by:
While testing my my program I came up with a consistency exception. My program consists of three datagridviews, One called dgvPostes which is the parent grid and its two children,one called...
3
by: John | last post by:
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...
5
by: John | last post by:
Hi I have developed the following logic to handle db concurrency violations. I just wonder if someone can tell me if it is correct or if I need a different approach.Would love to know how pros...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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?
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...

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.