Dim myDataset As New DataSet Dim myOleDbConnection As OleDbConnection = New OleDbConnection ( "Provider = Microsoft.Jet.OLEDB.4.0;" & _ "Data Source = d: /2.xls;" & _ "Extended Properties =" "Excel 8.0; "" ") Dim myoledbcommand as oledbcommand = new oledbcommand (" Select * from [Sheet1 $], myoledbconnection) DIM MyData as oledbdataadapter = New OledbDataAdapter (MyoledbCommand)
MyData.Fill (MyDataSet)
DataGrid1.datasource = mydataset.tables (0) .defaultView DataGrid1.database ()