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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Feb 6, 2013, 7:09 AM
Posted Feb 6, 2013, 7:22 AM
Thanks
VulpesPosted Feb 6, 2013, 6:36 AM
Posted Feb 6, 2013, 6:32 AM
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
VulpesPosted Feb 6, 2013, 6:17 AM
But you can do:
string decStr = "12.34";
Decimal dec = Decimal.Parse(decStr);
dr["Amount"] = dec; // say