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

Concurrency error when deletinga record from datagridview

18
Hi All,
I get an error when I try to delete a record from the datagridview, which says Concurrency violation:the DeleteCommand affected 0 of the expected 1 records .
Could someone please let me know which statement is causing this exception.

I have made use of wizards to establish connection and generate the datagridview on to my form rather than writing code.

Thanks in advance.
Feb 9 '07 #1
2 1202
RedSon
5,000 Expert 4TB
Hi All,
I get an error when I try to delete a record from the datagridview, which says Concurrency violation:the DeleteCommand affected 0 of the expected 1 records .
Could someone please let me know which statement is causing this exception.

I have made use of wizards to establish connection and generate the datagridview on to my form rather than writing code.

Thanks in advance.
The use of wizards should have produced some code. We have no idea what statement is causing the exception unless you post it. So why don't you post it and we can take a look. Also please highlight the line(s) that are causing the error.
Feb 9 '07 #2
artteam
18
The use of wizards should have produced some code. We have no idea what statement is causing the exception unless you post it. So why don't you post it and we can take a look. Also please highlight the line(s) that are causing the error.
The following statement is written by us which is calling the system generated code and it is the one which is raising the exception.

this.inventoryTableAdapter.Update((ArtStoreDataSet .InventoryDataTable)this.artStoreDataSet.Tables["Inventory"]);

System Generated Code: in bold
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private System.Data.OleDb.OleDbDataAdapter Adapter {
get {
if ((this._adapter == null)) {
this.InitAdapter();
}
return this._adapter;
}
}


Thank you in advance.
Feb 11 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Steve | last post by:
Visual Studio 2003 .Net / C# / SQL 2000 I am trying to work out the best way to ensure data concurrency in my application. All updates and inserts etc are done via stored procedures. When a...
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...
5
by: Bari Allen | last post by:
I'm trying to test for concurrency, using a SQL Stored Procedure on a RowVersion (timestamp) Field. The vb code I'm using is as follows Dim cmd As New SqlCommand("ConcurrencyCheck", cn) Dim...
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...
2
by: Agnes | last post by:
I got a simple form and using databinding manager to do the add new Now , my big trobule is . I can update the 'addnew' record, However, after I new the record, and then amend it , it got...
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...
0
by: russganz | last post by:
It seems to me there are real problems with the datagridview (along with the detailsview and form view) control when using optimistic concurrency with fields that can be null. Trying to use these...
1
by: artteam | last post by:
Hi All, I get an error when I try to delete a record from the datagridview, which says Concurrency violation:the DeleteCommand affected 0 of the expected 1 records . Could someone please...
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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: 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
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.