Type cast of Application Object
-
Dear friends, i have one Application Object Application["Discount"] = 5; when i am trying to cast this object into int i use the code (int)Application["Discount"]; but it shows an error Cannot unbox 'Application["Discount"]' as a 'int' any body can give me a description about this error Regards' Chippy
-
Dear friends, i have one Application Object Application["Discount"] = 5; when i am trying to cast this object into int i use the code (int)Application["Discount"]; but it shows an error Cannot unbox 'Application["Discount"]' as a 'int' any body can give me a description about this error Regards' Chippy
Try
Convert.Int32
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
-
Dear friends, i have one Application Object Application["Discount"] = 5; when i am trying to cast this object into int i use the code (int)Application["Discount"]; but it shows an error Cannot unbox 'Application["Discount"]' as a 'int' any body can give me a description about this error Regards' Chippy
try like this int value=(int)Application["Discount"].ToString(); OR int value=Convert.Toint32(Application["Discount"].ToString());
Jintal Patel