Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27355

VS 2012 VB.Net application doesn't read the rows on an SQL Table?

$
0
0
Hello everyone, back again.

I'm trying to run a check to see if a certain user is authenticated on DB or not and so far everytime I run the Login function, the debugger skips the check because no rows are found on the table, which is not true, because I have at least 2 rows on my database...

Here's the vb code for the Login function:

Code:

Private Sub btnUserLogin_Click(sender As Object, e As EventArgs) Handles btnUserLogin.Click
        Dim myDS As New File_Storage_Manager_DBDataSet
        If txtUsername1.Text = String.Empty And txtPassword1.Text = String.Empty Then
            'MessageBox.Show("")
        Else
            For Each rowLogin As File_Storage_Manager_DBDataSet.LoginRow In myDS.Login
                If txtUsername1.Text <> rowLogin.ID_User And txtPassword1.Text <> rowLogin.Password Then
                    MessageBox.Show("Incorrect username and/or password! Please try again.", "Data Mismatch", MessageBoxButtons.OK, MessageBoxIcon.Warning)
                Else
                    Dim fFSMTemp As fFileStorageManager = New fFileStorageManager
                    Me.Hide()
                    fFSMTemp.Show()
                End If
            Next
        End If
    End Sub

Note: The line that is red marked is where the debugger returns 0 rows and just skips to the End Sub, which leads me to believe there something missing.

My DataSet:
Name:  DS.png
Views: 3
Size:  13.9 KB

The rows that I have on Login Table:
Name:  LoginRows.png
Views: 3
Size:  12.2 KB

What am I missing here?
Attached Images
  

Viewing all articles
Browse latest Browse all 27355

Trending Articles