|
-
Jul 20th, 2007, 09:24 AM
#1
Thread Starter
Addicted Member
DataRowState.Modified
Hi,
I have a datagridview bound to a datatable, I want to check which rows have been updated and then update my database.
I have this
Dim dt As DataTable = dgMarketingWebsites.DataSource
For Each r As DataRow In dt.Rows
If r.RowState = DataRowState.Modified Then
' Do update here
End If
Next
The problem is that the state always seems to be added, even if changes have been made, am I missing something?
Thanks
-
Jul 20th, 2007, 09:44 AM
#2
Re: DataRowState.Modified
You don't save changes that way anyway. Check this out.
If the rows are Added then either you are adding them yourself or you have set the AcceptChangesDuringFill property of your DataAdapter to False, in which case the rows are not being set to Unchanged after they're retrieved.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|