It depends on the formats and units used by your strings.
Because it seems to be a floating point value, convert it to
double
first:
double diff = Convert.ToDouble(difftime);
Depending on the unit pass the value to the
TimeSpan
object (here for seconds):
TimeSpan t1 = TimeSpan.FromSeconds(diff);
Similar for the
grace
value.
[EDIT]
I missed how your function is called.
Change the function to accept
double
s instead of
string
s and call it with the values:
item.ATT_TOTAL_ATT = timeconvert(item.ATT_BIOIN_GRACE, item.ATT_DIFF_TIME);
This avoids the unnecessary conversions to
string
and back to
double
.
Or just make the calculation inline:
item.ATT_TOTAL_ATT = TimeSpan.FromSeconds(item.ATT_BIOIN_GRACE + item.ATT_DIFF_TIME).ToString();
[/EDIT]