Appointment, Resources, AppointmentResources and INSERT issue with Identity

2 posts, 0 answers
  1. John
    John avatar
    5 posts
    Member since:
    Dec 2010

    Posted 02 Feb 2011 Link to this post

    I am struggling with databinding the RadScheduler.
    I have the tables created, the constraints/relationships set up just fine.
    When I assign a resource to an existing appointment, the row is added to the AppointmentResource relationship table just fine into the database.

    However, when I try to assign a resource to a new appointment, I get a constraint error.
    When I remove the constraints, I see values like -4 in the AppointmentId column in the AppointmentResource table.
    So, I'm assuming that, since the AppointmentId in the Appointment table is set to IDENTITY, the code that handles the relationships doesn't know the AppointmentId yet when creating the rows to add to the AppointmentResource table.
    Is anyone aware of this, and do you have a workaround?  I'm thinking the only workaround is to bind to objects and do the database code myself..
  2. Dobry Zranchev
    Dobry Zranchev avatar
    353 posts

    Posted 07 Feb 2011 Link to this post

    Hello John,

    Thank you for writing.

    The IDENTITY field is not get by default when you are using a MSAccess data table. We provide an example in the Examples application shipped with our suite (section Scheduler >> Databinding)
    which demonstrates how to synchronize the IDENTITY field. In addition, you can find the available documentation for data binding here. It is important to set the name of the relation name to the Resources property of the AppointmentMappingInfo object.

    I hope that this will help you. In case that you have other related questions, feel free to write back.

    Best wishes,
    Dobry Zranchev
    the Telerik team
    Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
Back to Top