What would be the best way to store the RecurrenceRule and the RecurrenceParentId in the database? Would varchar and int, respectively, be the best data types to use in SQL?
Also, what would be the best way to translate a recurrence rule into something I can use somewhere else? For example, if I wanted to populate a DropDownList control with appointment titles and then upon SelectedIndexChanged, populate the second DropDownList with all of the available (recurring) time slots, would that be possible? If so, what would be the best way of going about it?
7 Answers, 1 is accepted
"What would be the best way to store the RecurrenceRule and the RecurrenceParentId in the database? Would varchar and int, respectively, be the best data types to use in SQL?"
The recommended storage for RecurrenceRule is varchar with maximum size of about 1024 characters. Most recurrence rules take much less and the extra space is needed for appending exception dates.
The RecurrenceParentID field is a foreign key pointing to the primary key, so it must be of the same type as the PK.
In order to make sense of the recurrence rule it should be parsed first. The Telerik.Web.UI.RecurrenceRule class makes this task easy. The following example first builds a recurrence rule, then converts it to string (as for storage in a database) and finally parses it and outputs the occurrence dates:
More information in the online documentation.
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
The recommended size is 1024 for optimization purposes, as it is rarely the case when there are so many exception dates that the total string count exceeds 1024 characters.
With that said, there should be no issue with increasing the number of characters limit.
I have an application that require lots of exceptions. At certain point, radscheduler stopped recording those.
The pattern or appointments that fail accepting the change is that the fielr RecurrenceRule are near the 1024 limit. I have doubled the field size to 2048 but still radscheduler will not process the new exception. Is there another place on radscheduler that I have to make an adjustment ? Database is SQL server 2014 and my Telerik version is UI for ASP.NET AJAX R1 2019 SP1 (version 2019.1.215)
The RadScheduler does not care about the length of the recurrence rules, so you can set the field size to an even bigger number.
There might be a possibility if when trying to save the recurrence rule, the SQL cut the text and that would lead to an invalid recurrence rule.
Please try creating a new appointment to the data base and start adding exceptions until the issue is observed again. It should work properly until the limit of the column size is met.