Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
Concurrency violation: the DeleteCommand
daniel burke
May 27 2016 7:12 AM
301
Reply
i am trying to update database after adding a row to a dataset but keep getting this error:
guage
Concurrency violation: the DeleteCommand affected 0 of the expected 1 records
i have not delete any rows just added one here is the code:
public void AddRow(System.Data.DataSet ds, string tablen, string[] info)
{
row = ds.Tables[tablen].NewRow();
row[0] = info[6];
row[1] = info[0];
row[2] = info[1];
row[3] = info[2];
row[4] = info[3];
row[5] = info[4];
row[6] = info[5];
ds.Tables[tablen].Rows.Add(row);
ds.Tables[tablen].DefaultView.Sort = "Date ASC";
objConnect.UpdateDatabase(ds, tablen);
}
public void UpdateDatabase(System.Data.DataSet ds, string tablen)
{
System.Data.SqlClient.SqlCommandBuilder cb = new System.Data.SqlClient.SqlCommandBuilder(da_1);
cb.DataAdapter.Update(ds, tablen);
}
please help
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Terminate Serial Recieved Data Handler
is it possible to convert whole xsd to xml ?