Dim conStr As String
Dim rs As OleDbDataReader
conStr = "provider=microsoft.jet.oledb.4.0;data source=" & Server.MapPath("data\留言.mdb")
conn = New OleDbConnection(conStr)
Dim comm As OleDbCommand
Dim comStr As String
comStr = "select * from 留言表"
comm = New OleDbCommand(comStr, conn)
Dim da As New OleDbDataAdapter
Dim ds As New DataSet
da.SelectCommand = comm
conn.Open()
da.Fill(ds, "留言表") '执行selectComma
e = ds.Tables(0).Rows.Count()
DataGrid1.DataSource = ds
DataGrid1.DataBind() '将数据集"ds"绑定到DataGrid1
conn.Close()