DataReader Not Matching Records?!?!

Results 1 to 2 of 2

Thread: DataReader Not Matching Records?!?!

  1. #1
    Join Date
    Dec 1969

    Default DataReader Not Matching Records?!?!

    I am trying to create a simple login script in C# that matches a username and pass from an SQL server 2000 dbase. I open the connection, create the sqlcommand (select password from table where username=&#039;whatever&#039;), and I execute the Datareader with the command. I know there will only be one match (at most), so I just use one datareader.Read() command. Then I try to do:<BR><BR>if( datareader.GetString(0) == "thepassword" )<BR> // Raise a AuthSuccess event<BR>else<BR> // Raise an AuthFailure event<BR><BR>this should work fine, however I ALWAYS get AuthFailure!!! I have only 1 entry in the entire sql dbase, but it absolutely refuses to match. Am I doing something wrong?? Please help! (note: the username and password of course are dynamic depending on what the user enters, however I set these as static values (exactly what they are in the dbase) and STILL i get AuthFailure.)<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: DataReader Not Matching Records?!?!

    ask in the forum<BR><BR><BR><BR>j<BR>http://www.readthe****

Posting Permissions

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