Specified cast is not valid error on datagrid

N

.Net Sports

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
 
G

Grant Merwitz

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top