Deleting rows in dataset

G

Guest

How can i delete a row in dataset based on the column value, i have four
columns in a row and i want to delete the row based on the column1 value.
 
M

Miha Markic [MVP C#]

Hi,

Select the rows you wish to delete (perhaps using DataTable.Select method or
dataview) and do an inverse for loop (from latest row to first row) - inside
the loop call DataRow.Delete method.
And, of course, call DataAdapter.Update to persist the changes in database
if you wish.
 

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