Hello all,
Not sure if this is the right place to post this.
I ran up the samples for adventureworks for MSSQL2005. I setup the shop front. The web site is up. But when I try to register a new user via the web page I get this error.
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.InvalidC astException: Specified cast is not valid.
Source Error:
Line 501:
Line 502: // Calculate the CustomerID using Output Param from SPROC
Line 503: int customerId = (int)parameterC ustomerID.Value ;
Line 504:
Line 505: return customerId.ToSt ring(CultureInf o.InvariantCult ure);
Source File: C:\Program Files\Microsoft SQL Server\90\Sampl es\Integrated Samples\Storefr ont\CS\StoreCli entComponents\C ustomersDB.cs Line: 503
Stack Trace:
[InvalidCastExce ption: Specified cast is not valid.]
Microsoft.Sampl es.SqlServer.Cu stomersDB.AddCu stomer(String firstName, String lastName, String email, String password) in C:\Program Files\Microsoft SQL Server\90\Sampl es\Integrated Samples\Storefr ont\CS\StoreCli entComponents\C ustomersDB.cs:5 03
Microsoft.Sampl es.SqlServer.Re gister.Register Button_Click(Ob ject sender, ImageClickEvent Args e) in c:\Program Files\Microsoft SQL Server\90\Sampl es\Integrated Samples\Storefr ont\CS\StoreCSV S\Register.aspx .cs:72
System.Web.UI.I mageClickEventH andler.Invoke(O bject sender, ImageClickEvent Args e) +0
System.Web.UI.W ebControls.Imag eButton.OnClick (ImageClickEven tArgs e) +105
System.Web.UI.W ebControls.Imag eButton.RaisePo stBackEvent(Str ing eventArgument) +115
System.Web.UI.W ebControls.Imag eButton.System. Web.UI.IPostBac kEventHandler.R aisePostBackEve nt(String eventArgument) +7
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler sourceControl, String eventArgument) +11
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain(Boolean includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +5102
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.507 27.42; ASP.NET Version:2.0.507 27.42
I don't have enough experience to know why line 503 is a problem and I'm not sure how to trouble shoot (sorry I'm new to this).
Has anyone had issues with this or can help?
Thanks
Ken :)
Not sure if this is the right place to post this.
I ran up the samples for adventureworks for MSSQL2005. I setup the shop front. The web site is up. But when I try to register a new user via the web page I get this error.
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.InvalidC astException: Specified cast is not valid.
Source Error:
Line 501:
Line 502: // Calculate the CustomerID using Output Param from SPROC
Line 503: int customerId = (int)parameterC ustomerID.Value ;
Line 504:
Line 505: return customerId.ToSt ring(CultureInf o.InvariantCult ure);
Source File: C:\Program Files\Microsoft SQL Server\90\Sampl es\Integrated Samples\Storefr ont\CS\StoreCli entComponents\C ustomersDB.cs Line: 503
Stack Trace:
[InvalidCastExce ption: Specified cast is not valid.]
Microsoft.Sampl es.SqlServer.Cu stomersDB.AddCu stomer(String firstName, String lastName, String email, String password) in C:\Program Files\Microsoft SQL Server\90\Sampl es\Integrated Samples\Storefr ont\CS\StoreCli entComponents\C ustomersDB.cs:5 03
Microsoft.Sampl es.SqlServer.Re gister.Register Button_Click(Ob ject sender, ImageClickEvent Args e) in c:\Program Files\Microsoft SQL Server\90\Sampl es\Integrated Samples\Storefr ont\CS\StoreCSV S\Register.aspx .cs:72
System.Web.UI.I mageClickEventH andler.Invoke(O bject sender, ImageClickEvent Args e) +0
System.Web.UI.W ebControls.Imag eButton.OnClick (ImageClickEven tArgs e) +105
System.Web.UI.W ebControls.Imag eButton.RaisePo stBackEvent(Str ing eventArgument) +115
System.Web.UI.W ebControls.Imag eButton.System. Web.UI.IPostBac kEventHandler.R aisePostBackEve nt(String eventArgument) +7
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler sourceControl, String eventArgument) +11
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain(Boolean includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +5102
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.507 27.42; ASP.NET Version:2.0.507 27.42
I don't have enough experience to know why line 503 is a problem and I'm not sure how to trouble shoot (sorry I'm new to this).
Has anyone had issues with this or can help?
Thanks
Ken :)