本人刚学ASP.NET。有个操作数据库的问题,求教
运行后的截图程序代码:
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click Dim constr As String = "provider=microsoft.jet.OLEDB.4.0;data source=e:\web_work\student.mdb" Dim conn As New OleDbConnection(constr) Dim sqlstr As String = "update stuInfo set SNO=" & TextBox1.Text & ",name='" & TextBox2.Text & "',sex='" & TextBox3.Text & "',age=" & TextBox4.Text & ",birth=" & Convert.ToInt32(TextBox5.Text) & ",class='" & TextBox6.Text & "',grade='" & TextBox7.Text & "',专业='" & TextBox8.Text & "',address='" & TextBox9.Text & "',简介='" & TextBox10.Text & "' where SNO='" & TextBox11.Text & "'" Dim cmd As New OleDbCommand() = sqlstr cmd.Connection = conn conn.Open() cmd.ExecuteNonQuery() conn.Close()
插入和更新数据提示出错,不知如何修改