datagrid|excel|显示|datagrid|excel
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.DataBind()
时间: 2024-09-16 05:46:37