My code for reading excel file is working properly for many of the rows but it doesnt display some contents in the file for e.g(#######) and dates for e.g (8/11/2009) but do display dates which have a 2 digit day in it for e.g(11/12/2011).
DataTable dtExcel = new DataTable();
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + HafizwalaFile + ";Extended Properties='Excel 8.0;HDR=No;IMEX=1'";
string strSQL = "SELECT * FROM [qe$] ";
OleDbConnection excelConnection = new OleDbConnection(connectionString);
OleDbDataAdapter dataAdapter = new OleDbDataAdapter(strSQL, excelConnection);
dataAdapter.Fill(dtExcel);
for (int i = 0; i < dtExcel.Rows.Count; i++)
{
for (int j = 0; j < dtExcel.Columns.Count;j++ )
{
System.Console.WriteLine(dtExcel.Rows[i][j]);
count_records++;
}
}