datatable updating

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What's the best way to update a datatable? For instace, if the datatable has
a column called tempbit with either a 1 or 0 in it, and i wanted to reset all
rows back to 0, what would be the best way to do that? I know i could just
loop row by row, but is there an eaiser way to just call a sql statement on
it? (update ... set tempbit=0)

In this case the datatable is binded to a typed dataset. If there is a way
to do it through a method on the dataset that would work fine in most cases.
 
Not sure if going through the dataset would be the best way...

Create a command object with CommandText = "update table set tempbit =
0"; and execute it as a nonquery.
 

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