469,935 Members | 2,225 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,935 developers. It's quick & easy.

Updating modified rows in a dataset

Hi All,

I have a dataset which is bind to a datagridview. When changes are made and that dataset is modified, i want to edit the dataset and update two datarow with WHO did the change and WHEN did the change occur.

Plz help. Thanks
May 14 '09 #1
1 2380
Solution found !!
What i did is create a new dataset and stored only modified rows in it. Then edit the new dataset modify the two datarows.
Expand|Select|Wrap|Line Numbers
  1. myds = ds.GetChanges(DataRowState.Modified)
  2.             For Each dr In myds.Tables("mytablename").Rows
  3.                 dr.BeginEdit()
  4.                 dr("UpdatedBy") =loggedUsername
  5.                 dr("UpdatedWhen") = tday.now()
  6.                 dr.EndEdit()
  7.             Next
  8.  
*****
Hope it will someone else.
May 14 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

9 posts views Thread by Bill Salling | last post: by
2 posts views Thread by Irvin | last post: by
11 posts views Thread by tomp | last post: by
3 posts views Thread by Geoff Jones | last post: by
4 posts views Thread by Geoff | last post: by
2 posts views Thread by susan.f.barrett | last post: by
16 posts views Thread by fniles | last post: by
reply views Thread by =?Utf-8?B?Y2RtdW5veg==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.