ado net and c# 2.0
i get different versions of excell files
how can i get correct version of xls files
select the data out of the sheets
if i open them in excell and save them as 4.0 xls all works fine
below is my sample code;
string ConnStr;
ConnStr = "Provider=Micro soft.Jet.OLEDB. 4.0;" +
"Data Source=d:\\junk \\Reject 596998_02262008 .xls;" +
"Extended Properties='Exc el 8.0;HDR=NO'";
//ConnsStr = "Provider=Micro soft.Jet.OLEDB. 4.0;Data
Source=c:\\temp \\data\\jhs.xls ;Extended Properties='Exc el 8.0;HDR=YES;'";
//REP.031.1079
//REP.031.1078
OleDbConnection SqlConn1 = new OleDbConnection (ConnStr);
OleDbCommand Cmd = new OleDbCommand();
Cmd.Connection = SqlConn1.Conn;
Cmd.CommandText = "Select * From [Repmso$]";
Cmd.Connection. Open();
OleDbDataReader Reader;
Reader = Cmd.ExecuteRead er();
DataTable abc = new DataTable();
dvOleDbReader.R eadToTable(Read er, abc);
Console.WriteLi ne(abc.Rows.Cou nt);
i get different versions of excell files
how can i get correct version of xls files
select the data out of the sheets
if i open them in excell and save them as 4.0 xls all works fine
below is my sample code;
string ConnStr;
ConnStr = "Provider=Micro soft.Jet.OLEDB. 4.0;" +
"Data Source=d:\\junk \\Reject 596998_02262008 .xls;" +
"Extended Properties='Exc el 8.0;HDR=NO'";
//ConnsStr = "Provider=Micro soft.Jet.OLEDB. 4.0;Data
Source=c:\\temp \\data\\jhs.xls ;Extended Properties='Exc el 8.0;HDR=YES;'";
//REP.031.1079
//REP.031.1078
OleDbConnection SqlConn1 = new OleDbConnection (ConnStr);
OleDbCommand Cmd = new OleDbCommand();
Cmd.Connection = SqlConn1.Conn;
Cmd.CommandText = "Select * From [Repmso$]";
Cmd.Connection. Open();
OleDbDataReader Reader;
Reader = Cmd.ExecuteRead er();
DataTable abc = new DataTable();
dvOleDbReader.R eadToTable(Read er, abc);
Console.WriteLi ne(abc.Rows.Cou nt);