Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Wrox Announcements and Feedback > All Other Wrox Books
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
All Other Wrox Books Do you have a question about a Wrox book that isn't listed anywhere on p2p.wrox.com or where the forum is locked? Here's a forum to post questions about any other Wrox book so that other readers or one of the authors can help you with your questions. IF YOU ARE LOOKING FOR CODE DO NOT ASK "Where can I find the code for this book?" That question is answered here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the All Other Wrox Books section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 9th, 2003, 09:30 AM
Authorized User
 
Join Date: Jun 2003
Location: Bronx, NY, USA.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to nodoubt223rd Send a message via MSN to nodoubt223rd Send a message via Yahoo to nodoubt223rd
Default ASP.NET E-Commerce Programming Problem - Design -

When I go to the shopping.aspx page I get the following error "Object reference not set to an instance of an object." Exception Details System.NullReferenceException: Object reference not set to an instance of an object

Source Error:

Line 44: cartContents.CartId = cartId;
Line 45:
Line 46: SqlPersistenceContiner spc = new SqlPersistenceContainer( CMPConfigurationHandler.ContainerMaps["CartContents"]);
Line 47: spc.Select( cartContents.ResulSet.Tables[0];

Source File: CartManager.cs Line 46

any help would be welcome:D

Brett G. Murphy
__________________
Brett G. Murphy
  #2 (permalink)  
Old June 9th, 2003, 10:16 PM
Registered User
 
Join Date: Jun 2003
Location: , , Australia.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you've typed the code in, this generally means that the name of a field in your web.config file doesn't match how it's coming out of the database. check that everything is matching up.

alternatively, you need to make sure you made the changes to the global.asax.cs file (setting up all the DBTypeHints etc etc).
  #3 (permalink)  
Old June 10th, 2003, 10:06 AM
Authorized User
 
Join Date: Jun 2003
Location: Bronx, NY, USA.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to nodoubt223rd Send a message via MSN to nodoubt223rd Send a message via Yahoo to nodoubt223rd
Default

Thanks for the suggestion I never thought to check that what a silly boy I am.

Thanks a Million

Brett G. Murphy
  #4 (permalink)  
Old June 10th, 2003, 11:40 PM
Authorized User
 
Join Date: Jun 2003
Location: Bronx, NY, USA.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to nodoubt223rd Send a message via MSN to nodoubt223rd Send a message via Yahoo to nodoubt223rd
Default

After finding my problem which was at the global.aspx.cs page I now get this error.
Server Error in '/' Application.
--------------------------------------------------------------------------------

SQL Server does not exist or access denied.
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.Data.SqlClient.SqlException: SQL Server does not exist or access denied.

Source Error:


Line 43: SqlCommand selectCommand = BuildCommandFromMapping( cmdMap );
Line 44: AssignValuesToParameters( cmdMap, ref selectCommand, selectObject );
Line 45: selectCommand.Connection.Open();
Line 46:
Line 47: if (selectObject is PersistableObjectSet)


Source File: C:\Inetpub\wwwroot\wineshopny\CMPServices\SqlPersi stenceContainer.cs Line: 45

Stack Trace:


[SqlException: SQL Server does not exist or access denied.]
   System.Data.SqlClient.ConnectionPool.GetConnection (Boolean& isInTransaction) +474
   System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
   System.Data.SqlClient.SqlConnection.Open() +383
   WS.CMPServices.SqlPersistenceContainer.Select(Pers istableObject selectObject) in C:\Inetpub\wwwroot\wineshopny\CMPServices\SqlPersi stenceContainer.cs:45

[Exception: Persistance (Select) Failed for PersistableObject]
   WS.CMPServices.SqlPersistenceContainer.Select(Pers istableObject selectObject) in C:\Inetpub\wwwroot\wineshopny\CMPServices\SqlPersi stenceContainer.cs:66
   WS.Web.ProductCatalog.ProductCatalog.GetChildCateg ories(Int32 categoryId) in C:\Inetpub\wwwroot\wineshopny\ProductCatalog\Produ ctCatalog.cs:37
   WS.Web.ProductCatalog.ProductCatalog.GetCategories () in C:\Inetpub\wwwroot\wineshopny\ProductCatalog\Produ ctCatalog.cs:23
   wineshopny.Global.Application_Start(Object sender, EventArgs e) in c:\inetpub\wwwroot\wineshopny\wineshopny\Global.as ax.cs:37




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573

I checked the web config file up and down I'm sure I put in the correct server name and password. the site is on a live web server with a SQL server installed on it I don't understand why it doesn't want to work.

Brett G. Murphy
  #5 (permalink)  
Old June 11th, 2003, 10:28 PM
Authorized User
 
Join Date: Jun 2003
Location: Bronx, NY, USA.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to nodoubt223rd Send a message via MSN to nodoubt223rd Send a message via Yahoo to nodoubt223rd
Default

I got it!:D

Brett G. Murphy
  #6 (permalink)  
Old June 17th, 2003, 09:57 AM
Registered User
 
Join Date: Jun 2003
Location: Durban, KZN, South Africa.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Cool, so how about letting the rest of us know what your solution was?
  #7 (permalink)  
Old June 18th, 2003, 09:22 AM
Authorized User
 
Join Date: Jun 2003
Location: Bronx, NY, USA.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to nodoubt223rd Send a message via MSN to nodoubt223rd Send a message via Yahoo to nodoubt223rd
Default

in the appsettings where your server name goes the webconfig file has server=(local)\dev; you have to remove the (local)\dev;. So it should look like server=myServer; (where my server = the name of your server and all should be well.

Brett G. Murphy
  #8 (permalink)  
Old June 27th, 2003, 05:42 PM
Registered User
 
Join Date: Jun 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

After I first built the solution and browsed default.aspx, I tried to add an item to the cart. I'm getting this error: "Object reference not set to an instance of an object." However, if I create a user and add an item to the cart while signed in with a user, it allows the add. Help would be lovely.

Line 248: oi.SKU = (string)currentRow["SKU"];
Line 249: oi.Special = false;
Line 250: >>>>>>>>>>>>>>> currentOrder.OrderItems.Add( oi );
Line 251:
Line 252: currentRunningTotal += extPrice;

Source File: C:\Inetpub\wwwroot\GWSetup\ShoppingCart.aspx.cs Line: 250

This is DIRECTLY after installing all code, restoring database, building the solution, and browsing the site - ALL within Visual Studios .NET and NOT hand-coded.

Thank - Garby
  #9 (permalink)  
Old June 30th, 2003, 09:29 PM
Registered User
 
Join Date: Jun 2003
Location: HCM, , Vietnam.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to luisandsoccer
Default

Quote:
quote:Originally posted by nodoubt223rd
 When I go to the shopping.aspx page I get the following error "Object reference not set to an instance of an object." Exception Details System.NullReferenceException: Object reference not set to an instance of an object

Source Error:

Line 44: cartContents.CartId = cartId;
Line 45:
Line 46: SqlPersistenceContiner spc = new SqlPersistenceContainer( CMPConfigurationHandler.ContainerMaps["CartContents"]);
Line 47: spc.Select( cartContents.ResulSet.Tables[0];

Source File: CartManager.cs Line 46

any help would be welcome:D

Brett G. Murphy
Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET E-Commerce Prog Problem - Design - gapoce All Other Wrox Books 42 February 9th, 2011 03:06 AM
ASP.NET E-Commerce Programming Problem-Design-Solu kenzhen All Other Wrox Books 1 April 27th, 2005 06:50 AM
ASP.NET E-Commerce Program Problem-Design-Solution ruimeisoft All Other Wrox Books 6 August 17th, 2004 03:10 AM
ASP.NET E-commerce Programming: Problem - Design - rmccue Wrox Book Feedback 1 February 9th, 2004 09:30 AM
ASP.NET E-Commerce Prog Problem - Design -Solution cat2123 All Other Wrox Books 1 December 29th, 2003 06:27 AM



All times are GMT -4. The time now is 04:55 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.