Raja

Raja

  • 547
  • 2k
  • 345.1k

How to Validate only Currency in datatable column asp.net c#

Nov 17 2016 1:13 AM
int value1;
float value2;
if (int.TryParse(ds.Tables[s].Rows[i][Columncountvalue + 9].ToString(), out value1) || !float.TryParse(ds.Tables[s].Rows[i][Columncountvalue + 9].ToString().Trim(), out value2))
{
  if (value1 <= 0)
{
//Alert message
}
}
validate the currency column have only numbers. now the problem is if the value is (12,000 ) in this format statement is executed and show the alert message.how solve this issue.now how to validate the currency.

Answers (1)