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?