Partial Class Login
Inherits System.Web.UI.Page
Public ObjDb As New Datacenter.Data.clsDBSQLBased(ConfigurationManager.ConnectionStrings("ConStr").ToString)
Protected Sub btnLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLogin.Click
Dim SQL As String
Dim dv As DataView
Dim intNumRows As Integer
SQL = "SELECT Username,Password FROM tb_complaint_CUser WHERE Username = '" & Me.txtUsername.Text & "' AND [Password] = '" & Me.txtPassword.Text & "' "
dv = ObjDb.GetDataSet(SQL).Tables(0).DefaultView
If intNumRows > 0 Then
Session("strUser") = Me.txtUsername.Text
Response.Redirect("MenuComplaint.aspx")
Else
Me.pnlLogin.Visible = False
Me.lblStatus.Visible = True
Me.lblStatus.Text = "Username/Password is wrong."
End If
Response.Write(SQL)
End Sub
End Class