Posted on: 4/23/2014 6:58:00 PM | Views : 430

I am filling up some literal on my web form with data retrieved from a database.  As they are a lot of controls it's a bit painful to write my code. I googled around and couldn't find a way to reference a control (Literal, Label, Textbox) by name.
Is it possible ?
My actual code
Do While objRdr.Read Select Case objRdr("myFieldName") Case "Field1" Me.Field1.text = objRdr("myValue") Case "Field2" Me.Field2.text = objRdr("myValue") Case "Field3" Me.Field3.text = objRdr("myValue") Case "Field4" Me.Field4.text = objRdr("myValue") Case "Field5" Me.Field5.text = objRdr( ...

Go to the complete details ...