英语翻译Dim myconn As Data.OleDb.OleDbConnection = New Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_Data/") + "data.mdb;Persist Security Info=False")Dim mysql As StringDim mycmd As Data.OleDb.
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/24 03:25:40
英语翻译Dim myconn As Data.OleDb.OleDbConnection = New Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_Data/") + "data.mdb;Persist Security Info=False")Dim mysql As StringDim mycmd As Data.OleDb.
英语翻译
Dim myconn As Data.OleDb.OleDbConnection = New Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_Data/") + "data.mdb;Persist Security Info=False")
Dim mysql As String
Dim mycmd As Data.OleDb.OleDbCommand
Protected Sub Button1_Click(ByVal sender As Object,ByVal e As System.EventArgs)
myconn.Open()
mysql = "update 1 set piaoshu= piaoshu + 1 where name='" + RadioButtonList1.SelectedItem.Text + "'"
mycmd = New Data.OleDb.OleDbCommand(mysql,myconn)
mycmd.ExecuteNonQuery()
myconn.Close()
ClientScript.RegisterClientScriptBlock(System.Type.GetType("System.String"),"_error","window.open('html/tp.aspx')")
Response.Redirect("2.aspx")
End Sub
英语翻译Dim myconn As Data.OleDb.OleDbConnection = New Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_Data/") + "data.mdb;Persist Security Info=False")Dim mysql As StringDim mycmd As Data.OleDb.
//新建数据库连接对象,参数是数据库的路径
Dim myconn As Data.OleDb.OleDbConnection = New Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_Data/") + "data.mdb;Persist Security Info=False")
Dim mysql As String //声明字符串类型的变量mysql
Dim mycmd As Data.OleDb.OleDbCommand //声明command对象
//按钮Button1的点击时调用的函数
Protected Sub Button1_Click(ByVal sender As Object,ByVal e As System.EventArgs)
myconn.Open() //打开数据库连接
mysql = "update 1 set piaoshu= piaoshu + 1 where name='" + RadioButtonList1.SelectedItem.Text + "'" //sql语句
mycmd = New Data.OleDb.OleDbCommand(mysql,myconn) //新建命令对象
mycmd.ExecuteNonQuery() //执行sql查询
myconn.Close() //关闭数据库连接
//向前台页面注册一段JS代码
ClientScript.RegisterClientScriptBlock(System.Type.GetType("System.String"),"_error","window.open('html/tp.aspx')")
//重定向到2.aspx页面
Response.Redirect("2.aspx")
End Sub