Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Write from DataTable object into database table 1

Status
Not open for further replies.

developer155

Programmer
Joined
Jan 21, 2004
Messages
512
Location
US
What is the best way to move data from in-memory data table into a real database table?

thanks
 
iterate through each row and perform an insert into your database.
 
not that ive been able to find myself - but you can use a transaction when you do your inserts in case you need to rollback on an error.
 
Guru7777 - that's a third party class, not part of .Net2.0.

------------------
When you do it, do it right.
 
dEVooXiAm, look up Bulk Copy with ADO.NET in MSDN Help for VS 2005

It is here on my system:

ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.VisualStudio.v80.en/WD_ADONET/html/83a7a0d2-8018-4354-97b9-0b1d99f8342b.htm


It quite clearly states that SQLBulkCopy is a new class in .NET Framework 2005


Hope this helps.

[vampire][bat]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top