Datatable column is typeof decimal.How can we add string value to this column.
thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Feb 6, 2013, 2:09 AM EST
VulpesRank #55 · 29.2K reputationPosted Feb 6, 2013, 1:17 AM EST
But you can do:
string decStr = "12.34";
Decimal dec = Decimal.Parse(decStr);
dr["Amount"] = dec; // say
Posted Feb 6, 2013, 1:32 AM EST
But the will be any word.
string decStr = "Name";
Decimal dec = Decimal.Parse(decStr);
dr["Amount"] = dec; // say
it gets error : Input string was not in correct format
VulpesRank #55 · 29.2K reputationPosted Feb 6, 2013, 1:36 AM EST
Posted Feb 6, 2013, 2:22 AM EST
Thanks