put a try catch and you'll be fine.
If ck1.Checked = True Then
dim d as Decimal = 0
try
d = Decimal.Parse(row.Cells(2)
catch ex as exception
d = 0
end try
If d <> 21 Then
Session("ierr_code_id") = Decimal.Parse(row.Cells(2)
GridView1.EditIndex = currentrow
Main Topics
Browse All Topics





by: steveberzinsPosted on 2007-06-11 at 19:05:54ID: 19263201
most likely row.Cells(2).Text, is a null value, or an empty string, that decimal.parse can't handle.
maybe test for IsNumeric, or maybe prepend it with a "0", Decimal.Parse("0" & row.Cells(2).Text), or...
but look and see what it is, it should give you at least a clue of what it doesn't like