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

Re: Mark DataTable dirty by Carl

Carl
Fri Nov 21 23:20:53 CST 2003

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


David Thielen wrote:

> 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