Problem in Updating records

gopal2006

Well-known member
Joined
Feb 1, 2006
Messages
63
Programming Experience
1-3
I am using command builder for inserting and updating of records. The records are inserted properly. But when I try to udate the records in the table No column is updated. I am not getting any error or exceptions
Can anyone guid me? Should I call GetChanges?
 
code

I am using Transcation Sever Where I have written Saving function

After creating the Dataset I wrote the code in the front end

Dataset.Tables("Tablename").Acceptchanges

for i=o to Dataset.Tables("Tablename").rows.count-1
Dataset.Tables("Tablename").rows(i).setmodified
next

In the Transaction Server

public function save(parameter1,..parameter n)
'After checking setting connection and checkin each datacolumn
DataAdapter.update(Dataset,Datatable.TableName)

'code for completing the transaction'
 
Erm, why do you SetModified() on the row? If you change the data then there will be something to update. If you call SetModified() without changing any data, a meaningless update will be sent to the DB - i.e. all the data will be updated to the same as it already is!
 
I used this while modifying the records. But I was not able to catch the exception.I removed them(i.e Set modified) and then I got the exception

Exception:

System.Data.DBConcurrencyException: Concurrency violation: the UpdateCommand affected 0 records.

Then I added some of the columns to the dataset which was there in the actual table but not in the dataset. But still it is throwing the same exception mentioned above.I tried to find out the solution the msdn website also. But can't find out what is happening:confused:
 
Can you run the DBDirect version of the command?

i.e. theTableAdapter.Delete(primary key values)


THis of course requires you to have generated dbdirect commands..
 
Back
Top