Dim excelapp As New Excel.Application
Dim excelbook As Excel.Workbook
Dim excelsheet As Excel.Worksheet
If OpenFileDialog1.ShowDialog = DialogResult.Cancel Then
Exit Sub
End If
excelbook = excelapp.Workbooks.Open(OpenFileDialog1.FileName)
excelsheet = excelbook.Worksheets.Item(1)
Dim conn As New Data.OleDb.OleDbConnection
Dim comm As New Data.OleDb.OleDbCommand
Dim adap As New Data.OleDb.OleDbDataAdapter
Dim DataTableReturn As New System.Data.DataTable("test")
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\111.xls;Extended Properties=excel 8.0;Persist Security Info=False"
comm.Connection = conn
comm.CommandText = "select * from [Sheet1$]"
adap.SelectCommand = comm
adap.Fill(DataTableReturn)