Solved

How to add 3rd validation for form login with UsernamePasswordString code?

Posted on 2011-03-16
3
214 Views
Last Modified: 2012-06-22
Hello,

I have below code for form login using validation from access database. In database I have now three columns, for user, for password, and new one for department.

Can someone show me how can I add also a deparment for login validation?

Maybe to adda combobox under password and userid, and that user will have to enter ID, Password, and choose from combobox a department to which belong.

 If UserIDTextBox.Text = "" Then
            ErrorProvider1.SetError(UserIDTextBox, "No UserID")
            Me.ActiveControl = UserIDTextBox
        Else
            If PasswordTextBox.Text = "" Then
                ErrorProvider2.SetError(PasswordTextBox, "No password")
                Me.ActiveControl = PasswordTextBox
            Else

                Dim login = Me.LoginIDTableAdapter1.UsernamePasswordString(UserIDTextBox.Text, PasswordTextBox.Text)
                If login Is Nothing Then
                    MsgBox("Error login.", MsgBoxStyle.Critical + vbOKOnly, "Error login")
                Else
                    MsgBox("Successfull login. " + UserIDTextBox.Text.ToUpper, MsgBoxStyle.Information + vbOKOnly, "Successfull login")
                    Form1.Show()
                    Me.Hide()
                End If
            End If
        End If

Open in new window


Thank you in advance for help.
0
Comment
Question by:dejandejanovic
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
Mamtha1982 earned 500 total points
ID: 35154719
Goto method UsernamePasswordString in LoginIDTableAdapter1 class, add new parameter to and change SQL statement & validation logic accordingly.
0
 

Author Comment

by:dejandejanovic
ID: 35167706
Uf, that is a explination for experts :-)

As, I'm a begginer, can you please show on example.

Thank you, and thx for reply.
0
 

Author Closing Comment

by:dejandejanovic
ID: 35167923
I have found. I have add a Department column in Sql statement, and also in Vb code.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now