A
Andy G
I am tring to loop through a dataset to find records that exist. If the
record exists then make the corresponding image visible. So I try to take
the row value and concatenate it onto a string ("imgSession"), so the
resulting control ID name will be imgSessionX. Where X could be a number
corresponding to the ID of the image. I need help with the logic.
Dim row As DataRow
Dim myImage As Image
Dim imgName As String = "imgSession"
For Each row In ds.Tables(0).Rows
'something like the below code, I realize this doesn't work
imgName = "imgSession" & row(0)
myImage.ID = imgName
myImage.Visible = True
Next
Not suprisingly I am getting the error "Object reference not set to an
instance of an object."
Thanks!
record exists then make the corresponding image visible. So I try to take
the row value and concatenate it onto a string ("imgSession"), so the
resulting control ID name will be imgSessionX. Where X could be a number
corresponding to the ID of the image. I need help with the logic.
Dim row As DataRow
Dim myImage As Image
Dim imgName As String = "imgSession"
For Each row In ds.Tables(0).Rows
'something like the below code, I realize this doesn't work
imgName = "imgSession" & row(0)
myImage.ID = imgName
myImage.Visible = True
Next
Not suprisingly I am getting the error "Object reference not set to an
instance of an object."
Thanks!