英语翻译Dim myconn As Data.OleDb.OleDbConnection = New Data.OleD
- 提问者网友:遁入空寂
- 2021-04-04 07:49
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
- 五星知识达人网友:独钓一江月
- 2021-04-04 08:27
//新建数据库连接对象,参数是数据库的路径
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
再问: 0.0好厉害啊 帮忙把这段也翻译一下吧 我加分!
再答: 把代码贴出来吧,图片加注释太费力了。。。
再问: http://zhidao.baidu.com/question/310330109.html