I'd like to add that the problem you are encountering is a very common issue of user input validation, you are attempting to convert other values (Convert.ToDecimal(TextBox
In addition to copy/pasting amit's code, you shoudl read up on and try some input validation, there are many levels you can approach this at, the first being the ASP.NET validator controls. On the server side, you can write wrappers for the common Convert methods and implement try/catch or other checks to gracefully handle this type of input..hope it helps
Main Topics
Browse All Topics





by: amit_gPosted on 2006-02-23 at 13:41:59ID: 16033625
string sGrossrevenue;
decimal Grossrevenue;
sGrossrevenue = row.Cells[3].Text.Trim().R
sGrossrevenue = System.Text.RegularExpress
if (sGrossrevenue != "")
{
Grossrevenue = decimal.Parse(row.Cells[3]
}
else
{
Grossrevenue = 0;
}