OLEDBCONNECTION OBJCONN = NULL; DATATABLE DT = NULL;
try {string connString = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = D: //Readme.xls; Extended Properties = Excel 8.0;"; objConn = new OleDbConnection (connString); objConn.Open (); dt = objconn.getoledbschematable (OLEDBSChemaGuid.Tables, NULL);
IF (dt! = null) {string [] sheetname = new string [dt.rows.count]; int i = 0; Foreach (Datarow Row In Dt.Rows) {SheetName [i] = row ["Table_name"]. TOSTRING (); i ;
}}} Catch (Exception E1) {...}