Insert from a DataTable

J

Jason Huang

Hi,

I have a DataTable dt, I wanna insert all records from dt to my SQL Server's
Database Table.
How would I do?
Thanks for help.


Jason
 
J

Jehu Galeahsa

Hi,

I have a DataTable dt, I wanna insert all records from dt to my SQL Server's
Database Table.
How would I do?
Thanks for help.

Jason

Set the InsertCommand on a SqlDataAdapter and then call the Update
method. I'm assuming you're manually calling Rows.Add on the DataTable.
 

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