This is a migrated thread and some comments may be shown as answers.

Circular reference error wile serializing to a sql data source

5 Answers 111 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Karl Wilkens
Top achievements
Rank 1
Karl Wilkens asked on 28 Apr 2011, 05:52 PM
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.

5 Answers, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 29 Apr 2011, 12:15 PM
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.

0
Karl Wilkens
Top achievements
Rank 1
answered on 30 Apr 2011, 01:04 PM
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?



0
Veronica
Telerik team
answered on 02 May 2011, 07:20 AM
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.

0
Karl Wilkens
Top achievements
Rank 1
answered on 05 May 2011, 06:09 PM
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.
0
Veronica
Telerik team
answered on 10 May 2011, 12:06 PM
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.

Tags
Scheduler
Asked by
Karl Wilkens
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Karl Wilkens
Top achievements
Rank 1
Share this question
or