Geoff,
Be aware two three, deleting of rows in a datatable (in fact are you doing
that) is one of the major AdoNet improvements in 2.0 because it is very
slow. If it is a complete table, than it is version 1.x probably better to
construct that table new. There is as well the command table.clear however
AFAIK is that as well slow in 1.x however than in 2.0 probably the best to
use to clear a complete table.
If you use the dataview with a rowfilter to delete a part of the table, than
I prefer the bottom up "for index".
For i as integer = dv.count - 1 until 0
dv(i).delete
Next
The advantage from this (not in this case) above the while loop is that if
you want to skip one datarow in the loop it keeps working.
I hope this helps,
Cor
"Geoff" <no********@ema il.com> schreef in bericht
news:VL******** ************@pi pex.net...
Hi
I'm hoping somebody can help me with the following.
I'm trying to delete all the rows in a dataview. There are 200 rows.
Everything works fine until I delete half way through and then I'm told in
an exception that
"There is no row at position 100"
The code I'm using is:
For Each i As Integer In MyList
dview.Delete(i)
Next
where MyList holds the numbers 0 to 199
There are 200 rows in the dataview (I can see them in a datagrid).
Can anybody tell me what I'm doing wrong?
Geoff