Data Tables REPost

B

Brian Shannon

I posted this question on Friday and haven't received a response. If I need
to add more content for clarification please ask:

My current solution works but I am looking to find if there is a more
efficient way of inserting multiple records from a data table to a DB.

I create a datatable tostore information in as my program is running. When
the program is finished I have about 20 records in the datatable.

I now need to insert these records into an sql2000 DB. I loop through the
table to insert 1 record at a time using the sqlcommand ExecuteNonQuery().

Is there a way to insert all the records from a datatable in 1 statement
to the DB? Here I am making 20 calls the my DB inserting 1 record at a
time. Hopefully there is a more efficient way.

If you need more info or more clarification please ask!

Thanks
 
A

Alvin Bruney [MVP]

have a look at the batch update for the provider, it may be what you are
looking for.
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top