Need some help here and I'm at a complete loss. I'm still relatively new to programming, and I'm doing a pretty big project for a company in helping them to automate their morning reports into Visual Studio on the 3.5 frame. So I'm getting the error:
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 49: clsMasterClass objMC = new clsMasterClass(); Line 50: Line 51: if (!objMC.Read(new DateTime(2013, 06, 15))) Line 52: { Line 53: string error = objMC.LastError; Line 54: Response.Write(error.ToString()); Line 55: // error handling Line 56: return; Line 57: }
Now, this code, and the entire program works perfectly. It access the SQL database, makes a table and inserts the data. It then finds the spot in the arrays created that tell the data where to go, and places the data into that part of the image. Like I said, everything runs perfectly fine when you compile it, however the above error happens when you publish it, which is a bit beyond me, so my boss is handling that part.
Any help is greatly appreciated.
Here's the stack information when we got the error:
[NullReferenceException: Object reference not set to an instance of an object.]
Proficy_Project.clsOptiSet.Read(DateTime ProdDate) in H:\Dev\Wallabee\Webpage\FinalProject\FinalProject\clsOptiSet.cs:70
Proficy_Project.clsMasterClass.Read(DateTime ProdDate) in H:\Dev\Wallabee\Webpage\FinalProject\FinalProject\clsMasterClass.cs:36
ASP.default_aspx.__Renderform1(HtmlTextWriter __w, Control parameterContainer) in c:\Inetpub\wwwroot\Wallaby\Default.aspx:51
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +163
System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +51
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
System.Web.UI.Page.Render(HtmlTextWriter writer) +29
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266