Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 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
 
Old September 23rd, 2007, 10:21 AM
Authorized User
 
Join Date: Sep 2007
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sully7
Default problem w/ StoreProvider and e-Commerce [RESOLVED]

Hello all,

I'm a fairly new ASP.NET programmer (very new at C#), and have been following this book (which i absolutely love by the way!). I've had minimal problems so far, and most of them were stupid typos, etc, but now i think I've hit a roadblock, and figured I'd ask everyone else's opinion.

In my StoreProvider class, I have the following:

Code:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;

namespace MB.TestingMachines.DAL
{
   public abstract class StoreProvider : DataAccess
   {
      static private StoreProvider _instance = null;

      static public StoreProvider Instance
      {
         get
         {
            if (_instance == null)
               _instance = (StoreProvider) Activator.CreateInstance(
                  Type.GetType(Globals.Settings.Store.ProviderType));
            return _instance;
         }
      }


Now, Visual Web Developer (2005 Express cause Microsoft is too expensive for a 17 year old like me :D ), comes up with no errors in any of my code, but when I try to access any of the pages that require this class, the following error comes up.

Code:
Server Error in '/Web' Application.
Value cannot be null.
Parameter name: type
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.ArgumentNullException: Value cannot be null.
Parameter name: type

Source Error:

Line 23:          {
Line 24:             if (_instance == null)
Line 25:                _instance = (StoreProvider) Activator.CreateInstance(
Line 26:                   Type.GetType(Globals.Settings.Store.ProviderType));
Line 27:             return _instance;


Source File: c:\Inetpub\wwwroot\Web\App_Code\DAL\StoreProvider.cs    Line: 25
I think I checked all of my other classes, and can't seem to find the problem. Anyone have any ideas on how to fix this?
 
Old October 5th, 2007, 09:55 AM
Authorized User
 
Join Date: Sep 2007
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sully7
Default

nevermind... problem solved.

 
Old October 5th, 2007, 11:01 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

sully7 - just in case someone else has the same issue, how did you actually fix this problem??

jimi

http://www.originaltalent.com
 
Old October 5th, 2007, 02:56 PM
Authorized User
 
Join Date: Sep 2007
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sully7
Default

in my code, i changed Mb.TheBeerHouse(etc,etc) to Mb.TestingMachines(etc,etc), so on one of the files that i was having trouble with I accidentally still had MB.TheBeerHouse(etc). After I realized that this was the problem, I did a project-wide search for "TheBeerHouse", found the one instance where it was used, and changed it back to my Mb.TestingMachines.

The issue was in ~/App_Code/ConfigSection.cs
below is the changed code:

Code:
[ConfigurationProperty("providerType", DefaultValue = "MB.TestingMachines.DAL.SqlClient.SqlStoreProvider")]
        public string ProviderType
        {
            get { return (string)base["providerType"]; }
            set { base["providerType"] = value; }
        }


I'm hoping to have my site up and fully running in a week or two (timing kinda sucks cause I'm still in high school), so I'm excited. I'll post a link in "Lets See your TBH site" when its done.


 
Old October 5th, 2007, 03:16 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

sully7 - good stuff. and anyway, high school 'can be' the best time of your life (so my mother used to say) ...anyway :)

jimi

http://www.originaltalent.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
[Resolved] IListSource problem in GridView snufse ASP.NET 2.0 Basics 5 February 12th, 2008 01:42 PM
[resolved] Trinidad & Tomcat Problem with examples pouet Apache Tomcat 1 May 11th, 2007 09:27 AM
[Resolved] Web Service CR Refresh problem windsurfkid Crystal Reports 1 February 24th, 2007 11:29 AM
Commerce server 2002 startup problem meghaaug17 All Other Wrox Books 0 July 5th, 2005 02:00 AM
microsoft commerce server startup problem meghaaug17 BOOK: Beginning Java 2 0 July 5th, 2005 01:53 AM





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