Hi Imar,
Thanks for the reply. Very much appreciated.
This is what I have now that is working. I'm able to get and assign the values to the labels fine. Actually this is someone else's code on my team and I'm looking at this and I don't know why the variable, Dim lblval As Label, is defined within the loop. Does that make any difference?
Code:
Dim SQL As String = "SELECT TankDefID, TankDefName, TankDataDesc FROM TankDefinitions WHERE RuleID = " & _RuleID
Dim oDA As New SqlDataAdapter(SQL, _oConn)
Dim oDS As New DataSet
Dim oDR As DataRow
oDA.Fill(oDS)
If oDS.Tables(0).Rows.Count > 0 Then
For Each oDR In oDS.Tables(0).Rows
Dim lblVal As Label = Page.FindControl("lbl" & oDR("TankDefName"))
lblVal.Text = oDR("TankDataDesc")
Next
Oops.
In my previous code I had.
Code:
Dim tdrVisible As HtmlTableRow = Page.FindControl("tr" & oDR("TankDefName"))
However, the id for the table tag is id=tdrTankBit1 and so forth and not trTankBit1. I don't know if that even is going to make any difference. The other developer has the page checked out now so I can't try that now.
I'll get the page, change the "tr" to "tdr" and get the exact line and error that it's generating.
If you have any ideas in the meant, they would be very much appreciated.
Thanks,
Richard