Excel connection Strings for .Net Application

Posted by Neeks under ASP.NET category on | Views : 3653
It is using OleDb as a Object for the connection to the Excel File.
OleDbCommand, OleDbConnection etc
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=path\myExcel2007file.xlsx;Extended Properties="Excel 12.0 Xml;HDR=YES;IMEX=1";

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=path\MyExcel.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";

Reading from Sheet
SELECT * FROM [SheetName$]

Here dollar sign ($) is compulsory

Comments or Responses

Login to post response