ช่วย ผมที่ครับ Login คือผม ต้องการLogin โดยใช้ข้อมูล จากฐานข้อมูล ช่วยที่ครับ ทำโปรแจคส่งอยุ่ครับขอบคุณครับ
Code:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If (TextBox9.Text = "") Then
MsgBox("กรุณากรอก Username ", MsgBoxStyle.OkOnly, "กรอก Username")
TextBox9.Focus()
ElseIf (TextBox10.Text = "") Then
MsgBox("กรุณากรอก Password ", MsgBoxStyle.OkOnly, "กรอก Password")
TextBox10.Focus()
Cls.Con.Close()
Try
Cls.Con.Open()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly, "ERROR")
End
End Try
Sql = "SELECT * FROM Login_01 where User_name='" & TextBox9.Text & "',Pass='" & TextBox10.Text & "'"
Dim Cmd As New SqlCommand(Sql, Cls.Con)
Dim Rs As SqlDataReader = Cmd.ExecuteReader
Dim User, Pass As String
Rs.Read()
User = CStr(Rs.Item("User_name"))
Pass = CStr(Rs.Item("Pass"))