Public Class LoginForm

    Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click


        If UsernameTextBox.Text = "" Or PasswordTextBox.Text = "" Then
            MsgBox("Username or Password is required!")
        Else
            mySQL("SELECT * FROM Table1 where UserUserName='" & UsernameTextBox.Text & "' and UserPassword = '" & PasswordTextBox.Text & "'")

            If dt.Rows.Count > 0 Then
                MsgBox("Welcome " & dt.Rows(0).Item(1))
                MainForm.Show()

            Else
                MsgBox("User account not registered!")
            End If


            Me.Hide()

        End If

        

    End Sub

End Class
