473,779 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.updcomCompan ies.Parameters. Add(New
System.Data.Ole Db.OleDbParamet er("Web_Enabled ",
System.Data.Ole Db.OleDbType.Bo olean, 2, "Web_Enable d"))

and

Me.updcomCompan ies.Parameters. Add(New
System.Data.Ole Db.OleDbParamet er("Original_We b_Enabled",
System.Data.Ole Db.OleDbType.Bo olean, 2,
System.Data.Par ameterDirection .Input, False, CType(0, Byte), CType(0, Byte),
"Web_Enable d", System.Data.Dat aRowVersion.Ori ginal, Nothing))

I startgetting a data concurrency error on mydataadapter.u pdate() 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 1226
Hi,

"John" <Jo**@nospam.in fovis.co.ukwrot e in message
news:uf******** ******@TK2MSFTN GP02.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.updcomCompan ies.Parameters. Add(New
System.Data.Ole Db.OleDbParamet er("Web_Enabled ",
System.Data.Ole Db.OleDbType.Bo olean, 2, "Web_Enable d"))

and

Me.updcomCompan ies.Parameters. Add(New
System.Data.Ole Db.OleDbParamet er("Original_We b_Enabled",
System.Data.Ole Db.OleDbType.Bo olean, 2,
System.Data.Par ameterDirection .Input, False, CType(0, Byte), CType(0,
Byte), "Web_Enable d", System.Data.Dat aRowVersion.Ori ginal, 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.Row Updating, check for
e.StatementType is Update and then check e.Command, print out the sql text
and all parameter(+valu es), 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.u pdate() 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
5125
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 store. I've done a fair amount of research on concurrency handling in newsgroups and other resources. Below is what I've come up as a standard for handling concurrency thru stored procedures. I am sharing with everyone so I can get some comments...
4
1910
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 carry out this action at the present time." error, runtime 2486. Subsequently Access will not exit the form, and shuts down uncleanly. Looking back on the messages here, this seems to be an indication of a corrupt object in the .mdb. So I imported...
4
3101
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 turning to the NG in hopes that someone can spot what I am doing wrong. Key to this technique working is the SQL UPDATE statement. It is designed to fail
8
5041
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 select, remember it, and then use it in the update. It works just fine when I have full control of the whole process. I want to do the same for my GridView/SqlDataSource combinations. I typically select from a view and update the corresponding...
4
2266
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 time, one of the apps will yield a concurrency violation error. The app with the error will have a little red error symbol next to the record in the datagrid, and the only way I can make the error go away for now is to restart that session. Is...
6
1236
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, page = 0, searchdburl = INDEX_URL, query_add = {}, queries = , form = True, limit = DEFAULT_LIMIT, tags = {}, order = ''): and def search(findquery, path = None, page=0, tags = {}, order='', limit = DEFAULT_LIMIT, queries=, searchdburl =...
4
1560
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 dgvPlans and the other dgvTanks. What happens is as follows. I will either create or edit a record in the datagridview dgvPlans and call the Updatedb procedure (code below). The first save works OK. Then when that is done, on the same record I will try...
3
1431
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 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
5
1852
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 handle it. Thanks Regards
0
9636
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9474
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9930
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8961
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7485
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2869
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.