I have a datagrid codebehind script that takes data from sql dbase and
displays it in a footer row as a total. One column has amount_dollars
(which works fine), while another has new sales (which is "newstotal"),
but I'm getting an error (System.InvalidCastException: Specified cast
is not valid) from the newstotal line:
price = (Decimal)(rowData["Amount_Dollars"]);
newstotal = (rowData["News"]);
newstotal is an integer, just wondering what datatype i should use
(whereas 'price' is a money datatype, and I can format it as Decimal,
but I just want the newstotal to be a simple integer. )Using (Integer)
or (short) in front of (rowData["News"]); give me the Specified cast
not valid error.
????
..netsports