Remove Detail in Datagrid,

A

Agnes

My datagrid is bind to a datatable , and i need to remove the blank amount
before save()
Now, if my datatable got over 4000 records, It really take a long time to
remove each of them ,
Does any easier and smart way to do ? Thanks in advance

Dim drTemp As DataRow
FOR Each drTemp In dtRvDetail.Select("debit=0 and credit=0 and voucherno ='"
& Me.txtVoucherNo.Text.Trim & "' ")
dtRvDetail.Rows.Remove(drTemp)
Next
 
C

Cor Ligthert

Agnes,

The speed of deleting rows from a datatable in Net 1.x is really bad. This
should be one of the improvements in 2.0. You can try to clone the table and
than not remove the rows however loop to the old and create a new one and
replace that in your dataset. If there is very much to remove that is
probably quicker.

I hope this helps,

Cor
 

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

Top