ASP.NET: saving changed data on postback

Thread is closed for posting
4 posts, 0 answers
  1. Mikael Kleinwort
    Mikael Kleinwort avatar
    22 posts
    Member since:
    May 2004

    Posted 07 Nov 2008 Link to this post

    I am unclear what is the best way to deal with this pretty common scenario using Telerik OpenAccess ORM:

    I have a simple webform (ASP.NET 3.5) used for editing records of data. On postback, the changed records need to be written back to the database.

    Where I am unclear is how do I accomplish the data update with concurrency check. When I do not use OpenAccess ORM but ASP.NET's LinqToSQL functionality, I use a DataConext to fetch the data from the database and fill the webform controls, and on postback, I read the same DataContext from the database, and I use the Attach() method to attach the changed objects from the webform to the DataContext. I can tell ASP.NET which fields to use to check for concurrency check (i.e. a last-changed-date field, or a combination of fields). The DataContext then knows whether an object is dirty, and it also knows which data needs to be written back to the database.

    I am entirely unclear about how to do this basic task with OpenAccess ORM, specifically the part where I attach a postback object to the ObjectScope. The only solution I have seen so far from the documentation is using an ObjectContainer, but this would mean that I need to store the entire ObjectContainer either in the webform or in SessionState on the server betwee postbacks.I can't imagine that this is the easiest way to proceed in ths basic scenario.

    I wouldd very much appreciate any input on this.
  2. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 10 Nov 2008 Link to this post

    Hi Mikael Kleinwort,

    I hope this is answered by the other reply.

    All the best,
    Jan Blessenohl
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Ken Grant
    Ken Grant avatar
    7 posts
    Member since:
    Oct 2004

    Posted 08 Jan 2009 Link to this post

    I thought this was a good question. But I can't see where it's been replied to. Any chance of of link.
  4. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 09 Jan 2009 Link to this post

    Hi Ken Grant,
    You have to use the OpenAccessDataSource to get this functionality. At the moment we are enhancing our DataSource so that you really can hook into all operations done by the web controls.

    You have to use the automatic DataSource functionality at the moment.

    All the best,
    Jan Blessenohl
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top