我是用vb.net 写的程序
其中temp为excel文件
Dim strConn, cmdstr1 As String
Dim conn As New OleDbConnection()
Dim mycommand As New OleDbDataAdapter()
Dim myDataSet As New DataSet()
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" & temp & ";" + "Extended Properties=Excel 8.0;"
conn = New OleDbConnection(strConn)
cmdstr1 = "select * from `" & temp & "`.`sheet1$` `sheet1$`"
mycommand = New OleDbDataAdapter(cmdstr1, strConn)
myDataSet = New DataSet()
mycommand.Fill(myDataSet)