Load an Excel file with DataGrid
First create a database connection
OLEDBCONNECTION CN = New OLEDBCONNECTION ("provider = microsoft.jet.Oledb.4.0; data source =" server.mappath ("xxxxx.xls") "; extended profment = excel 8.0;"); // xxxxx.xls Excel file
OLEDBADAPTER ADA = New OLEDBADAPTER ("Select * from [Sheet1 $], CN); // Sheet1 Which subfold
DataSet DS = New Dataset ();
Ada.fill (DS, "TTTT");
This.DataGrid1.datasource = ds.table [0] .defaultView;
THIS.DATAGRID1.DATABIND ();
// This will complete a simple load an Excel file.