an ASP.NET Open Source CMS & eCommerce platform
Search:
Skip Navigation LinksHome > DotShoppingCart Forums > Support > Using DotShoppingCart > Exception Error on DSC.User have no instance an...
Last Post 3/31/2010 3:52:53 PM By Bahram. 0 replies.
3/31/2010 3:52:53 PM
Bahram
Posts: 878
Joined: 12/8/2008
Location:Vancouver, BC Canada
Exception Error on DSC.User have no instance and returns null
I have these errors :
 
In Checkout page :
 
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.NullReferenceException: Object reference not set to an instance of an object.


Line 43:                 creditCardInput.ShowSaveAs = true;
Line 44:                 DSC.User user = DSC.User.GetUser(Page.User.Identity.Name);
Line 45:                 adiBilling.InitialAddressToDisplay = user.Address;
Line 46:                 List<CreditCard> creditCards = CreditCard.Get();
Line 47:                 if ((null != creditCards) && (creditCards.Count > 0)) {
 
 
 
My Account page:
 
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.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 30:         if (!IsPostBack) {
Line 31:             DSC.User user = DSC.User.GetUser(Page.User.Identity.Name);
Line 32:             billingAddress.InitialAddressToDisplay = user.Address;
Line 33: 
Line 34:             accountOptional.User = user;
When I debug in line 31 :

DSC.

User user = DSC.User.GetUser(Page.User.Identity.Name);
 
user has null value after the assignment.
 
It seems DSC can not vreate new instance.  Please advise.