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
C# |
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
C# |
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Suthish NairRank #92 · 22.8K reputationPosted Oct 24, 2010, 10:11 AM EDT
if using TextBox control, then use FindControl method to find the control.
JureRank #2,128 · 670 reputationPosted Oct 24, 2010, 10:28 AM EDT
What type is DgvLog...Value? You probably just need to parse it -> decimal.Parse(DgvLog...Value)
Irakli Lekishvili15 reputationPosted Oct 24, 2010, 11:01 AM EDT
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.
JureRank #2,128 · 670 reputationPosted Oct 24, 2010, 11:23 AM EDT
((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.
Sam HobbsRank #107 · 20.5K reputationPosted Oct 24, 2010, 12:34 PM EDT