[Solved] How to convert a string to a vb expression which includes control name in it


Hi guys thanks for your updates.. I wrote my own function by using your concepts and some other code snippets .I am posting the result

Function generate(ByVal alg As String, ByVal intRow As Integer) As String
Dim algSplit As String() = alg.Split(” “c)

    For index As Int32 = 0 To algSplit.Length - 1
        'algSplit(index) = algSplit(index).Replace("#"c, "Number")
        If algSplit(index).Contains("[") Then
            Dim i As Integer = algSplit(index).IndexOf("[")
            Dim f As String = algSplit(index).Substring(i + 1, algSplit(index).IndexOf("]", i + 1) - i - 1)
            Dim grdCell As Infragistics.Win.UltraWinGrid.UltraGridCell = dgExcelEstimate.Rows(intRow).Cells(f)
            Dim dblVal As Double = grdCell.Value
            algSplit(index) = dblVal
        End If

    Next

    Dim result As String = String.Join("", algSplit)
    'Dim dblRes As Double = Convert.ToDouble(result)
    Return result
End Function

Thanks again every one.. expecting same in future

solved How to convert a string to a vb expression which includes control name in it