G
Guest
Hi I am getting a exception while using a datareader here is the code
Me.SqlConnection1.Open()
Me.SqlReservationCheck.Parameters("@Ref").Value = Ref
Dim Reader As SqlClient.SqlDataReader = _
Me.SqlReservationCheck.ExecuteReader()
Dim I As Integer()
Dim Index As Integer = 0
If Reader.HasRows Then
While Reader.Read()
ReDim Preserve I(Index)
I(Index) = Reader.Item(0)
Index += 1
End While
End If
Reader.Close()
Me.SqlConnection1.Close()
When I execute the While Reader.Read() command the reader gives false
But the If Reader.HasRows Then returns true could someone help me with this
Me.SqlConnection1.Open()
Me.SqlReservationCheck.Parameters("@Ref").Value = Ref
Dim Reader As SqlClient.SqlDataReader = _
Me.SqlReservationCheck.ExecuteReader()
Dim I As Integer()
Dim Index As Integer = 0
If Reader.HasRows Then
While Reader.Read()
ReDim Preserve I(Index)
I(Index) = Reader.Item(0)
Index += 1
End While
End If
Reader.Close()
Me.SqlConnection1.Close()
When I execute the While Reader.Read() command the reader gives false
But the If Reader.HasRows Then returns true could someone help me with this