0
 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim b As String = ""

        If TextBox1.Text = "" Or TextBox2.Text = "" Then
            MsgBox("Data tidak lengkap", MsgBoxStyle.Information, "Login")
        Else
            conect = "select * from tbl_id"
            cmd = New SqlCommand(conect)
            dr = cmd.ExecuteReader()
            Try
                While dr.Read
                    If TextBox1.Text = dr("id") And TextBox2.Text = dr("pass") Then
                        b = "Ya"
                        Exit While
                    End If
                End While
                If b = "Ya" Then

                    Me.Hide()
                Else
                    MsgBox("ID Karyawan atau Password tidak ditemukan", MsgBoxStyle.OkOnly, "Login")
                End If
            Catch ex As Exception
                MsgBox(ex.Message)

            End Try
            dr.Close()

        End If
    End Sub
3
Contributors
2
Replies
15
Views
4 Years
Discussion Span
Last Post by GeekPlease
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.