OleDbConnection excel1 = new OleDbConnection ();
excel1.Connecti onString = "Provider=Micro soft.Jet.OLEDB. 4.0;Data
Source=C:\\Docu ments and Settings\\Jed\\ My Documents\\pro cd\
\testsheet.xls; Extended Properties=Exce l 8.0;";
OleDbDataAdapte r fillds = new OleDbDataAdapte r("SELECT
Barcode,Part_Co unt,Cycle_Time FROM [Sheet1$]", excel1);
System.Data.Dat aTable ds = new
System.Data.Dat aTable();
fillds.Fill(ds) ;
This is the code i am using but i am getting this error when i execute
the fill statement.
External table is not in the expected format.
What am i doing wrong here?Please help. thanks in advance
excel1.Connecti onString = "Provider=Micro soft.Jet.OLEDB. 4.0;Data
Source=C:\\Docu ments and Settings\\Jed\\ My Documents\\pro cd\
\testsheet.xls; Extended Properties=Exce l 8.0;";
OleDbDataAdapte r fillds = new OleDbDataAdapte r("SELECT
Barcode,Part_Co unt,Cycle_Time FROM [Sheet1$]", excel1);
System.Data.Dat aTable ds = new
System.Data.Dat aTable();
fillds.Fill(ds) ;
This is the code i am using but i am getting this error when i execute
the fill statement.
External table is not in the expected format.
What am i doing wrong here?Please help. thanks in advance
Comment