First of all, should it not be (decimal) instead of (Decimal).
Also, Try step through the CodeBehind and see what value
rowData["totalamount"].ToString() is
It may very well be null or blank, and then unable to convert.
you can also try (double)
".Net Sports" <ba********@cox.net> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
IN a datagrid code behind, I'm getting a "Specified cast is not valid"
error
price = (Decimal)(rowData["totalamount"]);
which was initialized as:
Decimal price;
????
.netsports