Server Error in '/H4H' Application.

Object reference not set to an instance of an object.

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 39: 		{
Line 40: 			dbCmdRetrieve = new OleDbCommand("SELECT gid, tblPhotoGalleries.cid, gname, gdescription, postdate, tblPhotoGalleries.updatedate, cname FROM tblPhotoGalleries, tblCommittees WHERE tblPhotoGalleries.cid IS NOT NULL AND tblPhotoGalleries.cid = tblCommittees.cid AND yid = ? ORDER BY tblCommittees.cid ASC, tblPhotoGalleries.updatedate DESC, gid ASC", dbConn);
Line 41: 			dbCmdRetrieve.Parameters.Add("@yid", OleDbType.Integer).Value = Int32.Parse(Session[SessionState.strSchoolYear].ToString());
Line 42: 		}
Line 43: 		else

Source File: c:\Inetpub\wwwroot\H4H\modules\galleries.ascx.cs    Line: 41

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   modules_galleries.Retrieve_Data(Boolean boolNew) in c:\Inetpub\wwwroot\H4H\modules\galleries.ascx.cs:41
   intranet_general_galleries.Retrieve_Data(Boolean boolDisplayNew) in c:\Inetpub\wwwroot\H4H\intranet\general\galleries.aspx.cs:48
   intranet_general_galleries.Page_Load(Object sender, EventArgs e) in c:\Inetpub\wwwroot\H4H\intranet\general\galleries.aspx.cs:41
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +47
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436


Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433