sql data reader issue.

  • Thread starter Thread starter Ratman
  • Start date Start date
R

Ratman

I have the following code:

Public Sub SelectAdminUserByID()

Try

Dim oDR As SqlDataReader =
oData.ExecuteReader(sConnectionString, CommandType.StoredProcedure,
"spSelectAdminUserByID")

'If oDR.HasRows Then
Do While oDR.Read()
Username = CType(oDR.Item("Username"), String)
Password = CType(oDR.Item("Password"), String)
Active = CType(oDR.Item("Active"), Boolean)
Loop
'End If

oDR.Close()

oDR = Nothing
oData = Nothing

Catch ex As Exception

End Try

End Sub

I am getting a "Object reference not set to an instance of an object."
error. It is bombing on the first reference to oDR. Can someone
please point out the problem here.
Thanks
 
Back
Top