data table contain column named as Fld_primary. this column contain value like 0.00 it is double datatype in mysql table.i want store that datatable value in double variable. am always getting error when i convert to double datatype.
my code
-------
Dim ds5 As dataset1.DTSUMDataTable = TA5.GetData(users)
Dim dttot As Double
dttot = CType(ds5("fld_primary").ToString, Double)
Error
Conversion from string "fld_primary" to type 'Integer' is not valid.
Your error is actually:
ds5expects an integer as a parameter, so usingds5("fld_primary")is not valid in your code. Perhaps you can tryds5(0)("fld_primary").After you fixed it, use
If you cannot ensure your string must be a valid
double, then useDouble.TryParse.