If your database is returning values which are literally
24.00,2.00,4.00
Then you have multiple values, and you can't store those in a single variable -= you need a separate one for each number in the sequence.
One way to handle this is to use Split:
string s1 = "24.00,2.00,4.00";
string s2 = "14.00,12.00,8.00";
string[] parts1 = s1.Split(',');
string[] parts2 = s2.Split(',');
for (int i = 0; i < Math.Min(parts1.Length, parts2.Length); i++)
{
float f1, f2;
if (float.TryParse(parts1[i], out f1) && float.TryParse(parts2[i], out f2))
{
Console.WriteLine("{0} + {1} = {2}", f1, f2, f1 + f2);
}
}
But you need to look at your DB and change it to not store comma separated values!