Datatable contain some values like 0.0,10000.00,54678.94 . am getting that values using for loop and store it in a variable in double datatype. i want to add these nos and store it in a variable.
each time variable value changed.
for loop
Dim ds5 As dataset1.pro_dtsumDataTable = TA5.GetData(TextBox1.Text, users)
If (ds5.Rows.Count > 0) Then
Dim y As Double
y = Double.Parse(ds5(0)("sum(fld_primary)").ToString())
Dim y1 As Double
y1 = 0 + y
End If
Next
first time y1=0.0
next time the value of y1 is not added to previous value.
i want the result y1=64679.34
am new to vb.net. please help to do this?
You keep assigning y to y1. I think what you want to do is
incrementthe value. egThe += is the same as: