简体   繁体   中英

I am importing data from Excel sheet to SQL Server to store in a table using an aplication

I have one Excel sheet, in that plenty amount of data is there, so need to write these data in the SQL server table directly. I searched in google but I didn't found a proper solution for my requirement.

My Excel contains the data in row wise, I mean that data is not continually provided. Having sub headings & some other information about tables description written after every table ended.

I hope you all understand my requirement. Please anybody have idea about this issue, or alternate solution to resolve. Have to store this excel data in to the SQL server table.

Here data is columns as rows & rows as columns. So how to read in this case.

firstname      vijay      vikram     vikek      varun

lastame        kumar      rathod      goshal    kandari

mobile         45425      456546      54656     454615   

Like above my data in excel sheet so how capture this kind of data.

Did you try using a excel interop.Using interop you can even read particular cells.You can read values by specifying a range and build a datatable or list.

These links may help

http://sandeep-aparajit.blogspot.in/2008/08/how-to-read-excel-in-c.html

C#: Getting a cell's value with Excel.interop

如果要在没有前端功能的情况下直接将数据插入db,则可以通过使用SSIS包或导入SQL Server中可用的功能来完成。

I have tried importing data from excel to sql server table. The process is in sql server right click on particular database and under tasks tab select import data option then select source excel file and destination table. It's working fine for me.

Thanks Venkat

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM