Results 1 to 5 of 5

Thread: Login

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Pilipinas
    Posts
    441

    Login

    Using this code to Log in

    'Filter
    DataSet11.User.DefaultView.RowFilter = "UserName = '" & TextBox1.Text & "' And Password='" & TextBox2.Text & "'"

    If DataSet11.User.Count = 1 Then
    Dim aForm As New MDIForm()
    aForm.Show()
    End If

    I have already the correct UserName and Password but I can't log in. Attached with this is the Project that I am doing. Please check it..

    Kindly help me to do this? Or any other idea to make my Login more presentable.
    Attached Files Attached Files

  2. #2
    Hyperactive Member
    Join Date
    May 2002
    Location
    Wisconsin, USA
    Posts
    279
    Change the code in your btnOK_Click procedure of the frmLogin to the following code. And it will work.

    VB Code:
    1. 'Filter
    2. DataSet11.User.DefaultView.RowFilter = "UserName = '" & TextBox1.Text & "' And Password='" & TextBox2.Text & "'"
    3.  
    4. Dim dv As DataView
    5. dv = DataSet11.Tables("User").DefaultView
    6.  
    7. If dv.Count = 1 Then
    8.      Dim aForm As New MDIForm()
    9.      aForm.Show()
    10. End If
    11.  
    12. dv.Dispose()

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Pilipinas
    Posts
    441

    It didn't work for me!

    I try to use the code but it doesn't work.
    'Filter
    DataSet11.User.DefaultView.RowFilter = "UserName = '" & TextBox1.Text & "' And Password='" & TextBox2.Text & "'"

    Dim dv As DataView
    dv = DataSet11.Tables("User").DefaultView

    If dv.Count = 1 Then
    Dim aForm As New MDIForm()
    aForm.Show()
    End If

    dv.Dispose()

    I try MessageBox.Show(dv.Count) and the message box display 0 even i type the correct username and password.

  4. #4
    Hyperactive Member
    Join Date
    May 2002
    Location
    Wisconsin, USA
    Posts
    279
    I ran the code on my own machine. I know it works.

    Ok, as long as you put in the correct username and password the first time it works. It didn't work when I typed the wrong password, then the right one.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Pilipinas
    Posts
    441
    Kindly attach the file for me. I try to do it here on my own but it really don't work.. pls.pls.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width