Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2011-03-16
3
Medium Priority
?
232 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
Praveen Kumar earned 2000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

604 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