Circular reference error wile serializing to a sql data source

6 posts, 0 answers
  1. Karl Wilkens
    Karl Wilkens avatar
    206 posts
    Member since:
    Oct 2012

    Posted 28 Apr 2011 Link to this post

    Hi,

    I am using a sql dataset and binding to the scheduler fine including several appointments that recur. However, on more than one occasion, I have used the recurrence editor to set a weekly or monthly event and I get

    A circular reference was detected while serializing an object of type 'System.Data.DataView'.



    The specific item where recurrence was just set is this

    ID 210
    Subject 'whatever'
    Description 'whatever'
    Start 2010-07-06 07:00:00.000
    End 2010-07-06 08:00:00.000
    RecurrenceRule DTSTART:20100706T070000Z  DTEND:20100706T080000Z  RRULE:FREQ=WEEKLY;UNTIL=20110701T000000Z;INTERVAL=

    If I clear out the recurrence rule, all is well.

    In the recurrence editor, am I skipping/not setting something properly? I edited the entire series, specified weekly recurrence on Tuesday, and set the end by to June 30 2011 and saved. after the save, the calendar displays fine. It is when I close the browser and revisit this same data, that I get the error, i.e. on initial binding. Any help appreciated.
  2. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 29 Apr 2011 Link to this post

    Hi Karl Wilkens,

    In the pasted code I can not see the INTERVAL :

    ID 210
    Subject 'whatever'
    Description 'whatever'
    Start 2010-07-06 07:00:00.000
    End 2010-07-06 08:00:00.000
    RecurrenceRule DTSTART:20100706T070000Z DTEND:20100706T080000Z RRULE:FREQ=WEEKLY;UNTIL=20110701T000000Z;INTERVAL=

    Also please note that "this is a built-in limitation of the JSON serializer. The JSON serializer implicitly requires its serialization targets to not contain infinite object graphs. For example the JSON serializer cannot serialize an array containing an entry that is a reference back to itself. In the reported case the JSON serializer is encountering a property somewhere on the DataView that eventually causes the JSON serializer to attempt to serialize the DataView all over again."

    Take a look at this forum post of Microsoft for the same error.

    Could you please open new Support thread and send me your project so I can inspect it and help you? 

    Thank you!

    Greetings,
    Veronica Milcheva
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. Karl Wilkens
    Karl Wilkens avatar
    206 posts
    Member since:
    Oct 2012

    Posted 30 Apr 2011 Link to this post

    Hi and thanks. Before I send a project I did a test where I put the same Event into XML instead of SQL like this

    Protected Overrides Sub OnInit(ByVal e As EventArgs)
           MyBase.OnInit(e)
            RadScheduler1.Provider = New XmlSchedulerProvider(Server.MapPath("~/App_Data/Appointments.xml"), True)
            RadScheduler1.MinutesPerRow = 60
        End Sub

    This worked fine and no errors occurred. So I started to look at the sql binding -

    RadScheduler1.DataSource = ds
    RadScheduler1.DataStartField = "Start"
    RadScheduler1.DataEndField = "End"
    RadScheduler1.DataSubjectField = "Subject"
    RadScheduler1.DataDescriptionField = "Description"
    RadScheduler1.DataRecurrenceField = "RecurrenceRule"
    RadScheduler1.DataKeyField = "EventID"
    RadScheduler1.DataRecurrenceParentKeyField = "EventID"

    RadScheduler1.SelectedView = SchedulerViewType.MonthView
     RadScheduler1.DataBind()

    I am wondering if the issue is the DataRecurrenceParentKeyField - which is the same as the DataKeyField? Could this be the issue?



  4. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 02 May 2011 Link to this post

    Hello Karl Wilkens,

    Yes, this is causing the problem. By setting the key of the appointment to be equal to the key of the recurrence parent - you make that all appointments are actually master appointments. However this is not correct as by definition even the master appointment will have parent.

    I'm glad that you've discovered the issue on your own.

    All the best,
    Veronica Milcheva
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  5. Karl Wilkens
    Karl Wilkens avatar
    206 posts
    Member since:
    Oct 2012

    Posted 05 May 2011 Link to this post

    This issue is still occurring even though we have a separate Column in the database for the RecurrenceParentID

    The behavior is puzzling - in debug mode I can view the Recurrence String and it appears as follows

    DTSTART:20100706T070000Z
    DTEND:20100706T080000Z
    RRULE:FREQ=WEEKLY;UNTIL=20110701T000000Z;INTERVAL=1;BYDAY=TU

    and even viewing the string going into the stored procedure it appears as above.
    but after it is stored in the database it is as follows and at this point, the scheduler stops working. We get  the previously mentioned error.

    DTSTART:20100706T070000Z  DTEND:20100706T080000Z  RRULE:FREQ=WEEKLY;UNTIL=20110701T000000Z;INTERVAL=

    I tried removing INTERVAL entirely by doing a SUBSTRING in the stored procedure, but that just introduced additional problems.
  6. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 10 May 2011 Link to this post

    Hello Karl,

    I can only assume that by some reason the RecurrenceRule is not written correctly in the database. However without seeing your code I can tell you what causes this issue.

    Could you please send me your project as well as the database so I can inspect it and help you?
    Thank you!

    Kind regards,
    Veronica Milcheva
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top