Hi all
I have a Products table which has a description and a size column the description is a string value and the size has a double value.
What I need to do is after reading the data it converts the decimals value of the size column into a fraction.
After the convertion I need to add a new column with the new fraction value onto the current datatable so I can populate the datagrid.
in the following code only the last value will be added on all the rows.
Private Sub ConvertDecimal2Fraction()
Dim val As Double
Dim fractColumn As New DataColumn
Dim rowcnt As Integer = (dtOrder.Rows.Count - 1)
For x = 0 To rowcnt
If IsNumeric((dtOrder.Rows(x)(3).ToString)) Then
val = CInt(dtOrder.Rows(x)(3).ToString)
With fractColumn
.ColumnName = "xttl"
.Expression = ((dlgNewTop.Dec2Frac(val, 2)))
End With
End If
Next
With dtOrder.Columns
.Add(fractColumn)
End With
End Sub