OleDbConnection conn = new OleDbConnection();
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Book.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";";
string[] tblrestrictions = { null, null, null, "TABLE" };
DataTable dt = conn.GetSchema("tables", tblrestrictions);
conn.Close();
dt.Rows.Count worksheet sayısını verir...
|