Namespace Using System.Data.OLDB; Private Void Excelread () {string patHexcel = "Haha.xls"; // Excel path
// read Excel pathExcel = Server.MapPath (pathExcel); string myString = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = '" pathExcel "'; Extended Properties = Excel 8.0"; OleDbConnection cnnXls = new OleDbConnection mYString;
String SQLINBOX = "Select * from [Sheet1 $]"; OLEDBDataAdapter DRINBOX = New OLEDBDataAdapter (SQLINBOX, CNNXLS);
DataSet DSINBOX = New Dataset (); DrinBox.Fill (DSINBOX); if (DSINBOX.TABLES [0] .rows.count> 0) {for (int i = 0; i