473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Problem with cast error in adventureworks sample

1
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.InvalidCastException: Specified cast is not valid.

Source Error:


Line 501:
Line 502: // Calculate the CustomerID using Output Param from SPROC
Line 503: int customerId = (int)parameterCustomerID.Value;
Line 504:
Line 505: return customerId.ToString(CultureInfo.InvariantCulture);


Source File: C:\Program Files\Microsoft SQL Server\90\Samples\Integrated Samples\Storefront\CS\StoreClientComponents\Custom ersDB.cs Line: 503

Stack Trace:


[InvalidCastException: Specified cast is not valid.]
Microsoft.Samples.SqlServer.CustomersDB.AddCustome r(String firstName, String lastName, String email, String password) in C:\Program Files\Microsoft SQL Server\90\Samples\Integrated Samples\Storefront\CS\StoreClientComponents\Custom ersDB.cs:503
Microsoft.Samples.SqlServer.Register.RegisterButto n_Click(Object sender, ImageClickEventArgs e) in c:\Program Files\Microsoft SQL Server\90\Samples\Integrated Samples\Storefront\CS\StoreCSVS\Register.aspx.cs:7 2
System.Web.UI.ImageClickEventHandler.Invoke(Object sender, ImageClickEventArgs e) +0
System.Web.UI.WebControls.ImageButton.OnClick(Imag eClickEventArgs e) +105
System.Web.UI.WebControls.ImageButton.RaisePostBac kEvent(String eventArgument) +115
System.Web.UI.WebControls.ImageButton.System.Web.U I.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.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 :)
Aug 4 '06 #1
0 1964

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Learner | last post by:
Hi there, I have installed Sql server 2005 developer on my machine which already has a Sql server 2000 installed on. Now i am trying to query the Sqlserver 2005 data(Ex: from Person.Address...
6
by: Nep Tune | last post by:
It goes like the following: Use AdventureWorks database and HumanResources.Department table. Create a stored procedure called spDepartmentAddUpdate. This procedure accepts two parameters: Name,...
0
by: ssengul | last post by:
Hi everyone, I have just installed MS SQL Server 2005 Enterprise Edition to practice administrative features. I have downloaded and installed the sample database called "AdventureWorks" on the...
0
by: BobLewiston | last post by:
I'm trying to install SQL2008.AdventureWorks_All_Databases.x86.msi, but whether I try to install "Sample Files" or "Create AdventureWorks DBs", I keep getting the following error: PrepInstance()...
1
by: BobLewiston | last post by:
After some initial problems with the prerequisite installation of SQL Server Express with Advanced Features, I tried to install AdventureWorks sample databases. Upon launch of the installer,...
0
by: BobLewiston | last post by:
How can I uninstall the AdventureWorks sample databases? They're not an application, so I can't do it via Add / Remove Programs or a downloaded uninstaller. They're apparently corrupt, and they've...
1
by: BobLewiston | last post by:
I’m trying to learn how to connect to an SQL Server database (I’m using the AdventureWorks sample database), but I’m having problems. Here’s the code I’m using: // define connection string for...
6
by: BobLewiston | last post by:
When I try to save a new (inserted) record in an SQL database, I get the following System.Runtime.InteropServices.ExternalException message: I have to either find out how to insert an...
2
by: BobLewiston | last post by:
Some of you may have seen my earlier thread “PasswordHash NULL problem”. I’ve started a new thread because investigation has shown that the problem is actually quite different than I previously...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.