Protected Sub Login1_Authenticate(sender As Object, e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate
Dim UserName As String = Login1.UserName
Dim Pwd As String = Login1.Password
Dim strConn As String
strConn = WebConfigurationManager.ConnectionStrings("dbConnectionSting").ConnectionString
Dim Conn As New SqlConnection(strConn)
Conn.Open()
Dim sqlUserName As String
sqlUserName = "select * From Regis "
sqlUserName &= " WHERE (E-mail = @UserName"
sqlUserName &= " AND Pass = @Password)"
Dim com As New SqlCommand(sqlUserName, Conn)
com.Parameters.Add("@UserName", SqlDbType.NVarChar).Value = UserName
com.Parameters.Add("@Password", SqlDbType.NVarChar).Value = Pwd
Dim dr As SqlDataReader = com.ExecuteReader
If dr.HasRows Then
'Session("UserAuthentication") = UserName
'Session.Timeout = 1
MsgBox("555555555+")
'Else
' Session("UserAuthentication") = ""
End If
dr.Close()
End Sub
เนี้ยคับมันขึ้น login file user เหมือนกับว่า sqlusername มันไม่ได้ไป ค้นหาในฐานข้อมูลเลยอะคับ ช่วยทีคับ