取不规范Excel的内容
gsxgw 2008-06-03 09:12:28 用一下方法可以取得Excel的内容
如:id name text
1 张 12893
Dim cn As System.Data.OleDb.OleDbConnection
Dim cmd As System.Data.OleDb.OleDbDataAdapter
Dim ds As New System.Data.DataSet()
cn = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;" & _
"data source=C:\myData.XLS;Extended Properties=Excel 8.0;")
' Select the data from Sheet1 of the workbook.
cmd = New System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1$]", cn)
cn.Open()
cmd.Fill(ds)
cn.Close()
但是如何获取不规范Excel 表中的内容
学员登记资料
2008-5-26
id name text
1 张 12893
2 张1 125
...........