Mark DataTable dirty

  • Thread starter Thread starter David Thielen
  • Start date Start date
D

David Thielen

Hi;

How can I mark a DataTable as dirty (has changes)? I need to do this
because when I add a DataColumn to a DataTable, it does not set
HasChanges() to true.

thanks - dave
 
Dave,

First of all, a datatable will be marked as dirty if its rows are dirty,
so you need to change the rows. As soon as you change/set a value on a
row, it becomes dirty. You may simply loop the table and do something
like that:

for each row as datarow in table
row(0) = row(0)
next

As dumb as it seems, the row will be marked "dirty" even if there's no
change. But you probably want to insert data in your new column?

Carl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top