This is my code:
Public UserBookings() As String
If dr.Read() Then
Dim intCounter As Integer
intCounter = 0
While dr.Read()
UserBookings(intCounter) = dr(0)
intCounter = intCounter + 1
End While
Return UserBookings
Else
Return False
End If
But I get this error at runtime:
A first chance exception of type 'System.NullReferenceException' occurred in Project.exe
And the array doesn't even seem to fill up.
Anything I can do to fix this? Bear in mind it is a dynamic array (I'm not sure how many entries it will have) so I don't see how I can loop through every entry and give it an initial value.
Thanks.