when i use this code vs shows following error : Specified cast is not valid. with title : InvalidCastExeption was unhandled
what is incorrect i think it must be work very good. cant find any mistake
|
when i use this code vs shows following error : Specified cast is not valid. with title : InvalidCastExeption was unhandled
what is incorrect i think it must be work very good. cant find any mistake
|
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted Oct 24, 2010, 4:34 PM
JurePosted Oct 24, 2010, 3:23 PM
((System.Data.SqlTypes.SqlMoney)DvgLog...Value).ToDecimal();
But I'm really surprised that you get the same error with decimal.Parse(...), since there is no casting involved, and even if you have forgotten to remove the "(decimal)" cast, it shouldn't throw a casting exception.
Irakli LekishviliPosted Oct 24, 2010, 3:01 PM
Suthish Nair
it does not work also. self price in sql table is type of money
Jure Ziberna
that code gets same error .it is money type
I use code like that another column and its work fine.
JurePosted Oct 24, 2010, 2:28 PM
What type is DgvLog...Value? You probably just need to parse it -> decimal.Parse(DgvLog...Value)
Suthish NairPosted Oct 24, 2010, 2:11 PM
if using TextBox control, then use FindControl method to find the control.