Click here to Skip to main content
15,993,735 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi guys,

im trying to import excel into database(SQL server 2008) as it is i.e. with data and columns and not in terms of bytes.... using visual studio 2008 ,asp.net 3.5...
I have approached it in 2 ways;

1)I have used exceldatareader of codeplex http://exceldatareader.codeplex.com/
But this is the dll with lot of bugs eg:date column getting converted to integer,some values are not read... this is really very bad and it has taken a lot of time.

2) I tried using sqlbulkcopy but that also gives an error here:

string xConnStr123 = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + "C:\\movies\\Test.xlsx" + ";" + "Extended Properties=Excel 9.0;HDR=Yes;";

Could not find installable ISAM.

please share the code for importing columns and data into database from excel......
I need it badly....
Posted

please share the code for importing columns and data into database from excel.
It does not work like this here.

Here is what is expected of enquirers:
1. TRY first what you want to do! You may find that it's not that hard.
2. Formulate what was done by you that looks like an issue/not working.

Try them and tell if you face issues.
Members will be more than happy to help like this.



For now, look here:
how to Import data from EXCEL to SQL Database in ASP.NET[^]
Importing Excel into SQL using ASP.NET 2.0 and SqlBulkCopy[^]
 
Share this answer
 
Quote:
1)I have used exceldatareader of codeplex http://exceldatareader.codeplex.com/
But this is the dll with lot of bugs eg:date column getting converted to integer,some values are not read... this is really very bad and it has taken a lot of time.

This is not an error !
In Excel, Date/Time values are stored as a floating point number.
The date is coded as the number of days since a reference date.
The time in day is coded in the fractional part of the value.

the date is simply a display formatting.

date only values look like integers.

I guess you need to use a conversion function to get a date.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900