Hi
I am trying to get data from excel sheet using oledbconnection , but I am unable to get the data into datatable.
The following is the code.
string strXMLToSave = string.Empty;
string strConn = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\ExcelDBPractice\ExcelDBPractice\bin\Debug\ExcelDBPractice.xlsx;
Extended Properties='Excel 12.0'";
OleDbConnection MyOLEConnection = new OleDbConnection(strConn);
OleDbCommand MySQLCommand = new OleDbCommand("SELECT * FROM [Sheet1$]", MyOLEConnection);
OleDbDataAdapter da = new OleDbDataAdapter(MySQLCommand);
DataSet ds = new DataSet();
da.Fill(ds);
DataTable dt = ds.Tables[0];
the data is not populated into datatable
Regards,
Sudha