Insert records from Excel

G

Guest

Hello

I'm working on code to upload an Excel file, read the spreadsheet contents
into a datagrid, then ultimately insert each row into a sql server database.

Currently I have the file upload and datagrid functionality working. I'm now
trying to determine the best way to get the data from the dataset that
populates the datagrid into sql server.

I know that there is a dts option but would like to do this without using
dts.

I'm guessing that there is a way to loop through the datagrid and build a
string for an insert statement but am wondering if it would be possible to
use the existing dataset and associated table and a second adapter to the db
to complete the upload.???

Thanks
 
J

john_teague

I think the standard way would be to use a DataSet for the datasource
and then a data adapter that has all of the insert/update/delete
methods defined for it and use the data adapter to insert new rows
added to the dataset.
 
J

john_teague

I think the standard way would be to use a DataSet for the datasource
and then a data adapter that has all of the insert/update/delete
methods defined for it and use the data adapter to insert new rows
added to the dataset.
 

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,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top