Monday, May 23, 2011

Connection string for Excel File


For excel 2003
string connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Book2.xls;Extended Properties=\"Excel 8.0;HDR='YES'\"";

And For Excel 2007
 string connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Book1.xlsx        Extended Properties=\"Excel 8.0;HDR=YES;\"";

No comments:

Post a Comment