Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a dataset table where I edit data, add rows and delete rows.

 

When I update the source database using the Update() method the added rows and edited items go through fine, but the deleted rows are still in my database.

 

I've tried AcceptChanges() but that seems to prevent all changes from being sent to the database.

 

So, my problem is how do I update the database from my dataset so it accepts edited data, added rows and deleted rows.

 

Thanks

TedN

Posted

What database are you using and what DbDataAdapter are you using?

 

Iterate through the DataTable rows and see if there are DataRow obejct's whose RowState is Deleted.

Posted
What database are you using and what DbDataAdapter are you using?

 

Iterate through the DataTable rows and see if there are DataRow obejct's whose RowState is Deleted.

 

Thanks for the reply. I've been checking out RowState and have a better understanding now. I don't use AcceptChanges at all now and use RowState to avoid accessing rows marked for deletion.

 

Thanks,

Ted

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...