Click here to Skip to main content
15,896,441 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
//Connection String to Excel Workbook

if (strFileType.Trim() == ".xls")

{

connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + ";Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=2\"";

}else if (strFileType.Trim() == ".xlsx")

{

connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=\"Excel 12.0;HDR=Yes;IMEX=2\"";

}

in this please expalin the string

 "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=\"Excel 12.0;HDR=Yes;IMEX=2\"";

and when i want to use otherthan MS Office like Kingsoft or open office what should i do...

Thanks in advance  :)

Posted

1 solution

Hello Guna1431

This question has been asked and answer in another forum. Please have a look on this link:

How to get data from excel sheet to datagridview in c#[^]

You may also benefit from using NPOI:
http://npoi.codeplex.com/[^]

And I've found some reference to this question forum:
http://stackoverflow.com/questions/657131/how-to-read-data-of-an-excel-file-using-c#[^]
 
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