All you have to do is go through the list of usernames until you find a match, then check the password. The code would be something like:
Public Function VerifyNamePassword(ByVal name As String, ByVal password As String) As Boolean Dim userNameCol = 0 'column containing username Dim passwordCol = 1 'column containing password For i = 0 To (Me.CustomersDataGridView.RowCount - 2) If Me.CustomersDataGridView.Item(userNameCol, i).Value.ToString.Equals(name) Then If Me.CustomersDataGridView.Item(passwordCol, i).Value.ToString.Equals(password) Then Return True 'if match is found End If End If Next Return False 'gone through entire table and no match is foundEnd Function
Hope that helps,
Yun