Hi all,

i am trying to write a password validation function, here is what i have so far:

Code:
   

    Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click

        'validate user login

        'check both fields contain some info
        If txtUserName.Text = "" Or txtPassword.Text = "" Then
            MsgBox("You must enter a valid username and password to continue.  Blank fields are not accepted.")
        Else
            'grab the user input
            uname = txtUserName.Text
            pwd = txtPassword.Text
            'create filter/dataiew
            Dim dv As New DataView(DsLogin1.Tables("tblpwd"))
            dv.RowFilter = "Username = 'uname' AND Password = 'pwd'"
            If dv.Count = 1 Then
                'open main form
                Dim frm1 As New frmMain
                frm1.Show()
            Else
                MsgBox("You have entered an invalid password, please try again.")
            End If
        End If

    End Sub
It runs but doesn't find the username or password.

any help appreciated.