1
Answer

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

Ask a question
Raja

Raja

7y
331
1
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)