C
Cdude
OleDbConnection excel1 = new OleDbConnection();
excel1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\\Documents and Settings\\Jed\\My Documents\\pro cd\
\testsheet.xls;Extended Properties=Excel 8.0;";
OleDbDataAdapter fillds = new OleDbDataAdapter("SELECT
Barcode,Part_Count,Cycle_Time FROM [Sheet1$]", excel1);
System.Data.DataTable ds = new
System.Data.DataTable();
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.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\\Documents and Settings\\Jed\\My Documents\\pro cd\
\testsheet.xls;Extended Properties=Excel 8.0;";
OleDbDataAdapter fillds = new OleDbDataAdapter("SELECT
Barcode,Part_Count,Cycle_Time FROM [Sheet1$]", excel1);
System.Data.DataTable ds = new
System.Data.DataTable();
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