View Single Post
  #1 (permalink)  
Old November 7th, 2004, 07:41 AM
liorlankri liorlankri is offline
Authorized User
Join Date: Oct 2004
Location: , , Israel.
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem in SQL query

I have this Code

CommandText = "SELECT firstName FROM Students Where Students.ID
='"&idNum& "'"

myCommand = New SqlCommand(CommandText, myConnection)
Dim name As String = myCommand.ExecuteReader.GetString(0)

I get this Error massage:

Exception Details: System.InvalidOperationException: Invalid attempt to read when no data is present.

Reply With Quote