DataTable
string excelFilePath = "D:\\sunny1.xls"; string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + excelFilePath + ";Extended Properties=Excel 12.0;"; OleDbConnection excelOledbConObj = new OleDbConnection(); excelOledbConObj.ConnectionString = connectionString; DataTable excelDataTable = new DataTable(); excelOledbConObj.Open(); OleDbCommand oledbCmdObj = new OleDbCommand(); oledbCmdObj.Connection = excelOledbConObj; try { OleDbDataAdapter oldataAdapterObj = new OleDbDataAdapter(oledbCmdObj); oledbCmdObj.CommandText = "Select * from [" +sb1.ToString()+"]"; oldataAdapterObj.Fill(excelDataTable); } catch (OleDbException ex) { Response.Write(ex.Message); }
EmpCode Title<br /> 999312 mr<br /> As9991 miss<br /> when i execute my application my datatable have data as follows<br /> 999312 mr<br /> NULL miss<br />
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)