0

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.

Anish V
  • 673
  • 3
  • 17
  • 38
  • Please check this link. Hope it helps http://stackoverflow.com/questions/657131/how-to-read-data-of-an-excel-file-using-c – shakz Oct 19 '12 at 07:53

3 Answers3

0

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

Community
  • 1
  • 1
Karthik
  • 2,391
  • 6
  • 34
  • 65
0

If you want to insert data into db directly, without front-end functionality, then you can do it by using SSIS packages or import functionality available in SQL server

SchmitzIT
  • 9,227
  • 9
  • 65
  • 92
  • Thank you very much...yes, i know that. but data will be not in proper order. rows are inserting as columns and columns are inserting as rows in database. – Vinod Bheemisetty Oct 19 '12 at 11:43
0

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

Venaikat
  • 197
  • 2
  • 5
  • 20