DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2007
    Posts
    13

    problem with my login form

    hi guys, i've created a form with 2 text box(UserName, UserPassword) and 1 button(LOGIN), I've added my data source from my database. I seem to have a problem with validating with my database where i've inserted my users and password there. Can anyone help me?

    Dim Conn As New SqlClient.SqlConnection("Data Source=DATA;Initial Catalog=MyDatabase1;Integrated Security=TruData Source=DATA;Initial Catalog=MyDatabase1;Integrated Security=True")
    Dim myCommand As String = "Select * From Users Where UserName=username AND Userpassword=userpassword"
    Dim mysqlcommand As New SqlClient.SqlCommand(myCommand, Conn)
    Dim mySqlReader As SqlClient.SqlDataReader

    mysqlcommand.Parameters.Add(New SqlClient.SqlParameter("Username", SqlDbType.VarChar))
    mysqlcommand.Parameters("Username").Value = UsernameTextBox.Text

    mysqlcommand.Parameters.Add(New SqlClient.SqlParameter("userpassword", SqlDbType.VarChar))
    mysqlcommand.Parameters("userpassword").Value = passwordtextbox.Text

    Conn.Open()
    mySqlReader = mysqlcommand.ExecuteReader

    If mySqlReader.HasRows Then
    Me.Hide()
    Options.Show()
    Else
    Me.Hide()
    ErrorMessage.Show()
    End If

    Conn.Close()

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    What problem are you having?
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. Replies: 0
    Last Post: 06-10-2002, 09:23 PM
  2. Problem validating form NEED HELP
    By Steve in forum Web
    Replies: 1
    Last Post: 01-04-2002, 03:32 AM
  3. ASP Cookies Login Twice Problem
    By ac7117 in forum ASP.NET
    Replies: 0
    Last Post: 11-09-2001, 09:45 AM
  4. ASP Cookies Login Twice Problem
    By ac7117 in forum ASP.NET
    Replies: 0
    Last Post: 11-09-2001, 09:14 AM
  5. Login Form
    By Mark in forum VB Classic
    Replies: 1
    Last Post: 10-02-2000, 11:59 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links