在 System.Data.OleDb.OleDbException 中第一次偶然出现的“System.Data.dll”类型的异常
ProtectedSubButton1_Click(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesButton1...
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strConnection As String
strConnection = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=F:\作业\动态网站作业\TUSHU\App_Data\book.mdb"
Dim myconn As New Data.OleDb.OleDbConnection()
strConnection += Server.MapPath("book.mdb")
myconn.ConnectionString = strConnection
myconn.Open() 它总说这未处理OleDbException
Dim SQL As String = "insert into [Book] ([BookID], [BookName], [Author]) Values ('TextBox3.Text','TextBox1.Text ',' TextBox2.Text')"
Dim insertcommand As New Data.OleDb.OleDbCommand(SQL, myconn)
insertcommand.ExecuteNonQuery()
Dim bookname, auther, bookid As String
bookname = Request.Form(TextBox1.Text)
auther = Request.Form(TextBox2.Text)
bookid = Request.Form(TextBox3.Text)
Response.Redirect("Default2.aspx")
myconn.Close() 展开
Dim strConnection As String
strConnection = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=F:\作业\动态网站作业\TUSHU\App_Data\book.mdb"
Dim myconn As New Data.OleDb.OleDbConnection()
strConnection += Server.MapPath("book.mdb")
myconn.ConnectionString = strConnection
myconn.Open() 它总说这未处理OleDbException
Dim SQL As String = "insert into [Book] ([BookID], [BookName], [Author]) Values ('TextBox3.Text','TextBox1.Text ',' TextBox2.Text')"
Dim insertcommand As New Data.OleDb.OleDbCommand(SQL, myconn)
insertcommand.ExecuteNonQuery()
Dim bookname, auther, bookid As String
bookname = Request.Form(TextBox1.Text)
auther = Request.Form(TextBox2.Text)
bookid = Request.Form(TextBox3.Text)
Response.Redirect("Default2.aspx")
myconn.Close() 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询