This question is locked. New answers and comments are not allowed.
I have spent a little time tracking down an error with my code.
The error occurred when trying to commit changes made to an object instance to the database. The error reported is reproduced here:
Now, I discovered that the problem appeared to be of my making. I was getting something back from the DB then, in an effort to cut down on the number of DB accesses, I was saving the object in my session state then, later, I was getting the item back from the Session, updating the values and attempting to write them back.
I assume that in saving the object to, or reading it back from, Session that some link to something in OA has been broken. There were no nulls in any of the objects in my code, so I have to assume that the OA elves somehow lost their way.
More for information than anything else, I'd love to hear why this happens.
--
Stuart
The error occurred when trying to commit changes made to an object instance to the database. The error reported is reproduced here:
System.NullReferenceException was unhandled by user code
Message="Object reference not set to an instance of an object."
Source="Telerik.OpenAccess.Runtime"
StackTrace:
at OpenAccessRuntime.DataObjects.PCStateMan.setStringField(PersistenceCapable _pc, Int32 field, String currentValue, String newValue)
at RSD.Model.Location.OpenAccessEnhancedSetname(Location , String )
at RSD.Model.Location.set_Name(String value) in C:\Users\Stuart\Documents\Visual Studio 2008\Projects\RSD.Model\Location.cs:line 98
at RSD.Website.Controls.LocationDetailsView.PopulateLocation() in c:\Users\Stuart\Documents\Visual Studio 2008\WebSites\RSD\Controls\School\LocationDetailsView.ascx.cs:line 156
at RSD.Website.Controls.LocationDetailsView.dv_ItemUpdating(Object sender, DetailsViewUpdateEventArgs e) in c:\Users\Stuart\Documents\Visual Studio 2008\WebSites\RSD\Controls\School\LocationDetailsView.ascx.cs:line 120
at System.Web.UI.WebControls.DetailsView.OnItemUpdating(DetailsViewUpdateEventArgs e)
at System.Web.UI.WebControls.DetailsView.HandleUpdate(String commandArg, Boolean causesValidation)
at System.Web.UI.WebControls.DetailsView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup)
at System.Web.UI.WebControls.DetailsView.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls.DetailsViewRow.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs 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)
Now, I discovered that the problem appeared to be of my making. I was getting something back from the DB then, in an effort to cut down on the number of DB accesses, I was saving the object in my session state then, later, I was getting the item back from the Session, updating the values and attempting to write them back.
I assume that in saving the object to, or reading it back from, Session that some link to something in OA has been broken. There were no nulls in any of the objects in my code, so I have to assume that the OA elves somehow lost their way.
More for information than anything else, I'd love to hear why this happens.
--
Stuart