ASP.net代码翻译
DimmyconnAsData.OleDb.OleDbConnection=NewData.OleDb.OleDbConnection("Provider=Microso...
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", "<script>window.open('html/tp.aspx')</sc" + "ript>")
Response.Redirect("2.aspx")
End Sub 展开
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", "<script>window.open('html/tp.aspx')</sc" + "ript>")
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 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", "<script>window.open('html/tp.aspx')</sc" + "ript>")
//重定向到2.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 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", "<script>window.open('html/tp.aspx')</sc" + "ript>")
//重定向到2.aspx页面
Response.Redirect("2.aspx")
End Sub
更多追问追答
追问
0.0好厉害啊 帮忙把这段也翻译一下吧 我加分!
追答
把代码贴出来吧,图片加注释太费力了。。。
广东轻亿云软件
2024-05-14 广告
2024-05-14 广告
广东轻亿云软件科技有限公司在软件开发领域深耕多年,积累了丰富的经验和技术实力。我们深知API接口在现代软件开发中的重要性,因此,我们与多家业界领先的API接口提供商保持着紧密的合作关系,确保我们的产品和服务能够充分利用这些接口,为用户提供更...
点击进入详情页
本回答由广东轻亿云软件提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询