protected sub botton1_click (...)...
Dim conn As OleDbConnection
Dim cmd As OleDbCommand
str = "insert into student(studentname,studentpassword,sex)values ('" & TextBox1.Text & "','" & textbox2.Text & "','" & dropdownlist1.SelectedItem.Value & "')"
conn = New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=" & Server.MapPath("text.mdb"))
Try
conn.Open()
cmd.Connection = conn
cmd.CommandText = str
cmd.ExecuteNonQuery()
cmd = Nothing
conn.Close()
Response.Redirect("用户登录页面.aspx")
Catch ex As Exception
Response.Write("注册失败")
End Try
TextBox1.Text = ""
textbox2.Text = ""
textbox3.Text = ""
Label5.Text = ""
End Sub
帮我看看拉,为什么每次运行botton1最后结果都是注册失败!!