Forums

ASP

This topic is locked

Insert DataSet into Database

Posted 21 Nov 2003 08:47:15
1
has voted
21 Nov 2003 08:47:15 Doerte Albrecht posted:
Hello,

I have a problem with .NET. I have to load a xls-File in .NET. That’s no problem with the OleDbConnection, the DataAdapter and the DataSet. Now I would like to insert all this data in a Database.

I tried to do that with SqlConnection, the SqlCommand,
MyCommand.Connection.Open() and MyCommand.ExecuteNonQuery()
MyCommand.Connection.Close().
Unfortunately that doesn't work.

Also I tried to put the SQLInsertCommand in a loop for each row in the DataSet, but then I got an error, that my valuevariables are already set.

Then I tried to do it with the upload statement. But that doesn't work as well. This is just for all these rows which are changed in some way.

May be you can help me and give me another way to insert a hole DataSet into a Database or how to insert the Excel-data into the database using ASP/VB .NET ?!

Thanks a lot,
Doerte

ps: don't blame me for my English. Actually I'm from Germany and just for an programming internship in Australia <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Reply to this topic