doerte

doerte

  • NA
  • 2
  • 0

insert multiple data into DB

Nov 23 2003 9:51 PM
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

Answers (2)