ACCESS数据库 的代码如下:
Dim xm1 As String
xm1 = TextBox1.Text
Dim strcon As String
strcon = "provider=microsoft.jet.oledb.4.0;data source=" & Server.MapPath("数据库名称")
Dim conn As New OleDbConnection(strcon)
Dim cmd As New OleDbCommand("select * from book where 此处为书名在数据库表中的字段名 = '%" & xm1 & "%' ", conn)
conn.Open()
Dim dr As OleDbDataReader = cmd.ExecuteReader()
GridView1.DataSource = dr
GridView1.DataBind()
conn.Close()