Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate
Dim cus_user As String
Dim cus_pass As String
cus_user = Login1.UserName
cus_pass = Login1.Password
Dim strConn As String
strConn = WebConfigurationManager.ConnectionStrings("Takemoru").ConnectionString
มันError ตรงTakemoru
Dim Conn As New SqlConnection(strConn)
Conn.Open()
Dim sqlUserName As String
sqlUserName = "Select UserName,Password From customer"
sqlUserName &= "Where (UserName =" & cus_user & ")"
sqlUserName &= "And(Password =" & cus_pass & ")"
Dim com As New SqlCommand(sqlUserName, Conn)
'Dim sqlUserName As String
'sqlUserName = "Select UserName,Password From UserName"
'sqlUserName &= "Where (UserName = @username "
'sqlUserName &= "And Password = @Password )"
'Dim com As New SqlCommand(sqlUserName, Conn)
'com.Parameters.AddWithValue("@UserName", username)
'com.Parameters.AddWithValue("@Password", Pass)
Dim CurrentName As String
CurrentName = CStr(com.ExecuteScalar)