I'm building an app that has the control (label) name and text stored
in a SQL table.  I'd like to read the record and then apply the label
from the database to the control on the webpage.  This will allow
users to change the label text as they see fit without me having to
change any code.

My problem:  I'm reading the record data into my app, but cannot seem
to get the label text to populate on my web page.  It seems like I'm
close but missing something simple (and I'm not a very good
programmer).  Any help would be appreciated...see my code below...

    Public Function PopulateFormLabels() As Boolean
        Dim oLabels As New wmESS_Class
        Dim dsLabels As DataSet = New DataSet
        Dim vLabelFieldName As String
        Dim vLabelField As Label = New Label
        Dim vLabel As String
        Dim str As String
        Dim vField As Label = New Label

        dsLabels = oLabels.GetCurrentLabels()

        Dim RowMbr As DataRow
        For Each RowMbr In dsLabels.Tables("Labels").Rows
            vLabel = ""
            vLabelField.ID = ""
            vLabelField.Text = ""
            vLabelFieldName = ""

            vLabelFieldName = RowMbr("LabelField")
            vLabelField.ID = vLabelFieldName
            vField.Text = RowMbr("Label")
            vLabelField.Text = RowMbr("Label")
            vLabel = vLabelField.Text
            'str = vLabelFieldName & ".Text = " & Chr(34) & vLabel &
Chr(34)
            'Response.Write(str)

        Next

    End Function

Reply via email to