vb.net and sql2000

  • Thread starter Thread starter Brian Shannon
  • Start date Start date
B

Brian Shannon

I run a vb.net application and store info into a datatable while processing.
I end up with a few hundred records when finished. After processing is
finished I need to take the records and update them into the sql DB.

Currently I loop through the datatable and insert one record at a time using
the sqlcommand ExecuteNonQuery(). Is there a better way?

All the reocords are new records so none of them will need updating. Once
the record is inserted into my datatable it is in its final form to be
inserted into my DB table. It's also at this point that I begin any
database connection steps needed.

Thanks for any suggestions
 
Currently I loop through the datatable and insert one record at a time
using the sqlcommand ExecuteNonQuery(). Is there a better way?

You could call a .Update from the DataAdapter. Or you could use a
Dataset... I think a Dataset has a .Update method too.
 
Hi Brian,

When there cannot be a concurrency problem (you are sure that the primary
key of records does not exist) than you have in my opinion now the best
solution.

The dataset does exactly the same, however has of course more overhead.

I hope this helps?

Cor
 
Back
Top