I want to add a few fields to the new events pageand save them in the DB and want to display.I have added a few fields and when I click add event button a null reference exception is being thrown. The error is as below. Can sombody please help me???
Caught Exception: System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at SubSonic.AbstractRecord`1.ValidateColumnSettings()
at SubSonic.ActiveRecord`1.Validate()
at SubSonic.ActiveRecord`1.Save(String userName)
at ClubStarterKit.Data.ClubEvent.Insert(DateTime varStarttime, Nullable`1 varEndtime, String varTitle, String varDescription, String varStaticURL, Int32 varPhoto, Nullable`1 varAlbum, Boolean varRsvp, Nullable`1 varTotalAttendance, Nullable`1 varCurrentAttendance,
String varLocationName, String varLocationDirections, Decimal decEventFee) in C:\ASPNETWebSites\IMSTCL\App_Code\DAL\Generated\ClubEvent.vb:line 520
at ASP.events_add_aspx.apply1_Click(Object sender, EventArgs e) in C:\ASPNETWebSites\IMSTCL\events\Add.aspx:line 71
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
--- End of inner exception stack trace ---
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.events_add_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Inner Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at SubSonic.AbstractRecord`1.ValidateColumnSettings()
at SubSonic.ActiveRecord`1.Validate()
at SubSonic.ActiveRecord`1.Save(String userName)
at ClubStarterKit.Data.ClubEvent.Insert(DateTime varStarttime, Nullable`1 varEndtime, String varTitle, String varDescription, String varStaticURL, Int32 varPhoto, Nullable`1 varAlbum, Boolean varRsvp, Nullable`1 varTotalAttendance, Nullable`1 varCurrentAttendance,
String varLocationName, String varLocationDirections, Decimal decEventFee) in C:\ASPNETWebSites\IMSTCL\App_Code\DAL\Generated\ClubEvent.vb:line 520
at ASP.events_add_aspx.apply1_Click(Object sender, EventArgs e) in C:\ASPNETWebSites\IMSTCL\events\Add.aspx:line 71
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
It happens when you use the SetColumnValue("ColumnName", val) to set object properties, setting a value to column that does not exists in the table schema. Also, maybe you forget to populate the Table schema of the class.
I'm sorry because i'm too late, but I needed help with this and have to find this solution by myself.
rkilambi
Member
12 Points
9 Posts
Addition of new fields to Events Page
Aug 25, 2008 02:19 AM|LINK
Hello Everyone,
I want to add a few fields to the new events pageand save them in the DB and want to display.I have added a few fields and when I click add event button a null reference exception is being thrown. The error is as below. Can sombody please help me???
Thanks
Renu
***************************************************************** trace ***************************************************************************************
Caught Exception: System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at SubSonic.AbstractRecord`1.ValidateColumnSettings()
at SubSonic.ActiveRecord`1.Validate()
at SubSonic.ActiveRecord`1.Save(String userName)
at ClubStarterKit.Data.ClubEvent.Insert(DateTime varStarttime, Nullable`1 varEndtime, String varTitle, String varDescription, String varStaticURL, Int32 varPhoto, Nullable`1 varAlbum, Boolean varRsvp, Nullable`1 varTotalAttendance, Nullable`1 varCurrentAttendance, String varLocationName, String varLocationDirections, Decimal decEventFee) in C:\ASPNETWebSites\IMSTCL\App_Code\DAL\Generated\ClubEvent.vb:line 520
at ASP.events_add_aspx.apply1_Click(Object sender, EventArgs e) in C:\ASPNETWebSites\IMSTCL\events\Add.aspx:line 71
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
--- End of inner exception stack trace ---
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.events_add_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Inner Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at SubSonic.AbstractRecord`1.ValidateColumnSettings()
at SubSonic.ActiveRecord`1.Validate()
at SubSonic.ActiveRecord`1.Save(String userName)
at ClubStarterKit.Data.ClubEvent.Insert(DateTime varStarttime, Nullable`1 varEndtime, String varTitle, String varDescription, String varStaticURL, Int32 varPhoto, Nullable`1 varAlbum, Boolean varRsvp, Nullable`1 varTotalAttendance, Nullable`1 varCurrentAttendance, String varLocationName, String varLocationDirections, Decimal decEventFee) in C:\ASPNETWebSites\IMSTCL\App_Code\DAL\Generated\ClubEvent.vb:line 520
at ASP.events_add_aspx.apply1_Click(Object sender, EventArgs e) in C:\ASPNETWebSites\IMSTCL\events\Add.aspx:line 71
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
*************************************************************************************************************************************************************************************
scaryman
Member
7 Points
2 Posts
Re: Addition of new fields to Events Page
Feb 10, 2010 04:54 PM|LINK
It happens when you use the SetColumnValue("ColumnName", val) to set object properties, setting a value to column that does not exists in the table schema. Also, maybe you forget to populate the Table schema of the class.
I'm sorry because i'm too late, but I needed help with this and have to find this solution by myself.