Tampilan Desain
Listing:
Protected Sub cmdLogin_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdLogin.Click
Dim mysql As String
Dim newClass As New Class1
Dim userid As String = txtUser.Text
Dim password As String = txtPassword.Text
Dim ds As DataSet
'mysql = "select * from TabelUser where UserId='" + userid + "' and Password='" + password + "' "
mysql = "execute Masuk '" + userid + "','" + password + "'"
newClass.fcConnect()
ds = newClass.sQuery(mysql)
Dim dt As DataTable
dt = ds.Tables(0)
If dt.Rows.Count = 1 Then
Session("userID") = txtUser.Text
Response.Redirect("WebForm5.aspx")
Else
MsgBox(" Password anda salah")
End If
End Sub
No comments:
Post a Comment