Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Wrox Announcements and Feedback > All Other Wrox Books
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old July 16th, 2003, 03:19 PM
Registered User
 
Join Date: Jul 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default System.NullReferenceException: Object reference...

I've bought the book ASP.NET ECommerce Programming - Problem, Design, Solution.

I've downloaded and installed the code and database from WROX.COM, but I have one problem. When i'm trying to add products to the cart, I get the following error:

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


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

Plz help!



  #2 (permalink)  
Old July 16th, 2003, 03:22 PM
Registered User
 
Join Date: Jul 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

[NullReferenceException: Object reference not set to an instance of an object.]
   GW.Web.ShoppingCartPage.RenderAndSum(DataRowView currentRow) in C:\Inetpub\wwwroot\GWSetup\ShoppingCart.aspx.cs:25 0
   ASP.ShoppingCart_aspx.__DataBind__control26(Object sender, EventArgs e) in C:\Inetpub\wwwroot\GWSetup\ShoppingCart.aspx:166
   System.Web.UI.Control.OnDataBinding(EventArgs e) +66
   System.Web.UI.Control.DataBind() +26
   System.Web.UI.Control.DataBind() +86
   System.Web.UI.Control.DataBind() +86
   System.Web.UI.WebControls.DataGrid.CreateItem(Int3 2 itemIndex, Int32 dataSourceIndex, ListItemType itemType, Boolean dataBind, Object dataItem, DataGridColumn[] columns, TableRowCollection rows, PagedDataSource pagedDataSource) +169
   System.Web.UI.WebControls.DataGrid.CreateControlHi erarchy(Boolean useDataSource) +1403
   System.Web.UI.WebControls.BaseDataList.OnDataBindi ng(EventArgs e) +48
   System.Web.UI.WebControls.BaseDataList.DataBind() +23
   GW.Web.ShoppingCartPage.LoadData() in C:\Inetpub\wwwroot\GWSetup\ShoppingCart.aspx.cs:12 2
   GW.Web.ShoppingCartPage.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\GWSetup\ShoppingCart.aspx.cs:76
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Page.ProcessRequestMain() +714


  #3 (permalink)  
Old September 12th, 2003, 11:10 AM
Registered User
 
Join Date: Aug 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Did you ever find a solution to this error:
NullReferenceException: Object reference not set to an instance of an object.]?


TLC
  #4 (permalink)  
Old January 6th, 2004, 05:05 AM
Authorized User
 
Join Date: Jun 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try deleting all records in the Shoppincarts table.
  #5 (permalink)  
Old January 7th, 2004, 01:06 AM
Registered User
 
Join Date: Jan 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How did you declare current order as






Similar Threads
Thread Thread Starter Forum Replies Last Post
System.NullReferenceException JayLou BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 1 April 6th, 2007 12:55 PM
System.NullReferenceException: Object reference no HelpWanted ASP.NET 1.0 and 1.1 Basics 11 October 24th, 2006 04:50 PM
System.NullReferenceException lwheless BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 September 24th, 2006 05:47 AM
System.NullReferenceException: Object reference no nidy_online VS.NET 2002/2003 2 June 9th, 2004 09:17 PM
[NullReferenceException: Object reference not set creiche ASP.NET 1.0 and 1.1 Basics 3 September 23rd, 2003 08:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.