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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Upload excel/csv file to database using VB.Net

Status
Not open for further replies.

nelco

Programmer
Apr 4, 2006
93
US
Need to upload data from excel/csv file into SQL Server database using VB.net. Any ideas how this can be done? Any help would be appreciated?
 
Why do you need to use VB.Net? I would use SSIS/DTS. If need, you can call an SSIS package from VB.Net.
 
This needs to be done in an application (i am using VB.net) where in the user can upload the file which gets put in the database. Since I am new to VB.net, I wasn't sure that we could call SSIS package from VB. If possible, could you tell me how to do this or point me to any resources which would help?

thanks a lot.
 
If the end user doesn't have SQL tools installed, I'm not sure that it will work as they will not be able to reference the SSIS libraries.

Another option is to use BULK INSERT

Other than that, there is not really simple way to do this in pure .Net. I would probably start out by using a text driver to create a connection to your text files, reading the data into a DataSet. Next, loop through the DataSet and DataTables and execute SqlCommands against your DataRows while validating your data.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top