Skip to content

I need help bad in fixing this problem

MATT Mc

Asked Aug 26, 2010, 1:32 PM EDT3 answers
Share
LinkedInX
when i try to login i get this error please help me in fixing the problem anyone.

Specified cast is not valid.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidCastException: Specified cast is not valid.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

VB.NET
[InvalidCastException: Specified cast is not valid.]
   PCNAdmin.WebForm1.ValidateUser(String userName, String passWord) +380
   PCNAdmin.WebForm1.cmdLogin_ServerClick(Object sender, EventArgs e) +67
   System.Web.UI.HtmlControls.HtmlInputButton.OnServerClick(EventArgs e) +108
   System.Web.UI.HtmlControls.HtmlInputButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain() +1292

3 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Mahesh Chand
    0
    This is a generic error.
    Try to put your code in a try..catch statement to get the exact error message. OR post some code that is getting this error.
    0
  • 0
    I think i uploaded the code but may be wrong so here it is any help will be appriciated.
    0
  • Mahesh Chand
    0
    OK don't upload your HTML code. Error seems to be coming from ValidateUser(String userName, String passWord) method.
    Do you know how to implement try..catch error handling? If not, I suggest you learn error handling. Search this site and place a try...catch in your code to get exact error message.
    Cheers!
    0