need help in ASP.Net coding ?

Demeer 007

New member
need help in finding errors in this code:
(


Partial Class Account_Register
Inherits System.Web.UI.Page

Public Function update(ByVal name As String, ByVal password1 As String) As Integer

Dim conString As String = "Data Source=PSYREG-PC\SQLEXPRESS;Initial Catalog=master;Integrated Security=True"

Dim sqlCom As SqlCommand = New SqlCommand()

Dim sqlCon As SqlConnection = New SqlConnection(conString)

sqlCom.Connection = sqlCon
sqlCom.CommandText = "UPDATE login1 SET password1=" + password1 + "'WHERE name=" + name + "'"

sqlCom.CommandType = CommandType.Text

sqlCon.Open()
Dim result As Integer = sqlCom.ExecuteNonQuery()
sqlCon.Close()
Response.Write("Password Successfully Changed")
Return result
End Function

Public Sub b1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles B1.Click
update(TextBox9.Text, TextBox10.Text)

End Sub

End Class

)
 
Back
Top