urgent help for Vb.net Login page using sql statement

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2006
Posts: 11
Reputation: kipl20 is an unknown quantity at this point 
Solved Threads: 0
kipl20 kipl20 is offline Offline
Newbie Poster

urgent help for Vb.net Login page using sql statement

 
0
  #1
Mar 13th, 2008
i have made a simple login page with 2 textboxes for username and password and a button to login.
the usernames and passwords are in an sql database . how would i go about retrieving the username and password from the database.
i have tried a select where statement

If TxtUsername.Text = "" And TxtPassword.Text = "" Then
MessageBox.Show("Please enter username and password")

ElseIf TxtUsername.Text = "" Then

MessageBox.Show("Please enter username")
ElseIf TxtPassword.Text = "" Then

MessageBox.Show("Please enter Password")

ElseIf SqlDataAdapter1.SelectCommand.CommandText "SELECT * FROM Managers WHERE managerID = '+ TxtUsername.Text +' and password = '+ txtPassword.text+ " Then
FrmManView.Show() .
but this does not appear to do anything, what am i doing wrong? i am a beginner so any help will be appreciated thanks
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: urgent help for Vb.net Login page using sql statement

 
0
  #2
Mar 13th, 2008
ElseIf SqlDataAdapter1.SelectCommand.CommandText "SELECT * FROM Managers WHERE managerID = '+ TxtUsername.Text +' and password = '+ txtPassword.text+ " Then
FrmManView.Show()
you not checked input just select data from input.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC