VB Code:
  1. Dim objConnection As New SqlClient.SqlConnection _
  2.                     ("server=.;database=ndbs;trusted_connection=true")
  3.  
  4.         Dim objCommand As New SqlClient.SqlCommand _
  5.             ("Select * From tblUsers", objConnection)
  6.  
  7.         Dim objReader As SqlClient.SqlDataReader
  8.  
  9.         ' Open the database connection
  10.         objConnection.Open()
  11.  
  12.         ' Put the results in the DataReader object
  13.         objReader = objCommand.ExecuteReader
  14.  
  15.         Do While objReader.Read  
  16.  
  17.             If objReader.Item("password") = "password" Then
  18.                 Response.Write("The Password Is Password")
  19.             End If
  20.  
  21.         Loop
  22.  
  23.         objReader.Close()
  24.         objConnection.Close()
  25.  
  26.  
  27.     End Sub

The problem I have is that when I use the following :

VB Code:
  1. If objReader.Item("password") = "password" Then
  2.                 Response.Write("The Password Is Password")
  3.             End If

It just does not recognize that I am trying to compare the strings. It is so frustrating, if I do a response.write(objReader.Item("password")) whilst the datareader.read loop goes around then it does display the information that the DataReader pulls from the sql database.

Is it because the DataReader is read-only????

Any ideas?????

Cheers,


Matt.