PC Review


Reply
Thread Tools Rate Thread

DataTable Update problem?

 
 
Özden Irmak
Guest
Posts: n/a
 
      7th Feb 2005
Hi,

I've a datatable in a dataset which I populate a group of records from code.
When I call the update method of the relevant sqldataadapter to that
datatable I get this error :

Concurrency violation: the UpdateCommand affected 0 records.

My code which populates the records in that datatable is like this :

MyDataRow = EditBaseDataSet.Tables["Tbl_OrderDetails"].NewRow();

MyDataRow["OrderId"] = EditBaseDataSet.Tables["Tbl_Orders"].Rows[0]["Id"];

MyDataRow["PlayDate"] = MyDate;

MyDataRow["TimeFrameId"] =
EditBaseDataSet.Tables["Tbl_TimeFrames"].Rows[j]["Id"];

MyDataRow["ClientId"] = MySqlDataReader["ClientId"];

MyDataRow["ItemCount"] = integerUpDown1.Value;

EditBaseDataSet.Tables["Tbl_OrderDetails"].Rows.Add(MyDataRow);

I disabled the concurrency check in DataAdapter but this didn't help.
Another weird thing is that all the records in that table are new where the
error states the problem occurs in UpdatCommand?

I use Visual C# 2003 with Sql Server 2000 backend.

Any help will be appreciated...

Thanks,

Özden Irmak


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update datatable 1 with information from datatable 2 using an updatestatement. Hetal Microsoft ADO .NET 0 5th May 2008 05:54 PM
datatable update error (does update instead of insert) Scott Emick Microsoft VB .NET 1 19th Sep 2005 09:50 PM
Update a Datatable =?Utf-8?B?QXJuZQ==?= Microsoft Dot NET Framework 2 7th Apr 2005 01:17 PM
update DataTable from other Datatable ??? gemalas Microsoft ADO .NET 3 17th Mar 2005 08:33 AM
Clone DataTable or Copy DataTable Problem Kelvin Microsoft C# .NET 0 13th Dec 2004 07:55 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:21 PM.