I tried to open a Excel file using the code below:
string excelfilename = openFileDialog1.FileName;
string connString =
+excelfilename+
;
System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(connString);
conn.Open();
System.Data.OleDb.OleDbCommand selectAllComand = new System.Data.OleDb.OleDbCommand("SELECT * FROM [sheet1$]");
System.Data.OleDb.OleDbDataReader excelReader = selectAllComand.ExecuteReader();
conn.Close();
But I got this error at the conn.Open() line: "Couln not find installable ISAM"...
Anyone knows why
|