问题是可以运行可是数据库里的密码没有改变 求高手帮忙修改
Public Class idmodify
Inherits System.Web.UI.Page
#Region " Web 窗体设计器生成的代码 "
'该调用是 Web 窗体设计器所必需的。
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected WithEvents TextBox2 As System.Web.UI.WebControls.TextBox
Protected WithEvents TextBox3 As System.Web.UI.WebControls.TextBox
'注意: 以下占位符声明是 Web 窗体设计器所必需的。
'不要删除或移动它。
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: 此方法调用是 Web 窗体设计器所必需的
'不要使用代码编辑器修改它。
InitializeComponent()
End Sub
#End Region
Dim objconn As New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
Dim comdstr As String
Dim comd As SqlCommand
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim pwd1, pwd2, pw As String
pwd1 = Request.Form("TextBox2")
pwd2 = Request.Form("TextBox3")
If TextBox2.Text <> TextBox3.Text Then
Response.Write("<script LANGUAGE='javascript'>alert('两次输入密码不一致');history.go(-1);</script>")
Else
objconn.ConnectionString = "data source =(local);database=xzl;uid=sa;pwd="
comdstr = "updata employeeid set pw = '" & pwd1 & "' where id='" & Session("id") & "' "
comd = New SqlCommand(comdstr, objconn)
comd.Connection.Open()
comd.Connection.Close()
Response.Write("<script LANGUAGE='javascript'>alert('修改成功');history.go(-1);</script>")
Response.End()
End If
End Sub
End Class