RecurrenceRule Not Working When Programmatically Assigned In SQL DB

2 posts, 0 answers
  1. Dan
    Dan avatar
    19 posts
    Member since:
    Aug 2010

    Posted 20 Sep 2010 Link to this post

    I'm using SQL server, I have my datastructure set to that of the Telerik Demos.  I am trying to take one large appointment in my Appointments table and bust it up into several little appointments. Why would I be doing such a boneheaded thing? This is why. So, I have everything working fantastically.  My users create an appointment from 9:00-3:15 and in the database, I change it to 12 half hour appointments.  There is one glitch though.
         When I create an Appointment record and INSERT the data for the RecurrenceRule field, RadScheduler will not recognize the rule.  It sees the appointment and registers that it is a recurring rule (by the little circle/arrow in the top left-hand of the appointment) but the recurring appointments never show up if you click to the next week(s).  If you double click on the appointment and go to the advanced form, the recurrrence box is NOT checked and none of the fields filled in for recurrence.
      I can hear you thinking now, "His cowboy programming has dorked up Teleriks perfection. He's messed up the data he's inserting into the field."  Well, here is where we get thrown down the rabbit hole.  If I use the RadScheduler and edit one of the new appointments and make a recurring rule, it works perfectly!  The recurring appointments show up for the next week(s).  Furthermore, if I then go to the appointment record (in the database) that RadScheduler has just updated, the rule looks exactly the same as the one I created programmatically. SQL says it is identical.   And one more kicker, if I take that rule which radscheduler has created/updated in the database, and insert it into another record's RecurrenceRule field (changing the time/date to match of course), then it still won't work for that record/appointment.
      I don't see how this can be happening. The rules are identical but RadScheduler seems to know when I have entered in the data and when IT has.  It's as if there are some hidden characters somewhere that clue RadScheduler into the fact that I typed the rule in instead of it.

    UPDATE Appointments
    SET RecurrenceRule = 'DTSTART:20110317T160000Z  DTEND:20110317T170000Z  RRULE:FREQ=WEEKLY;UNTIL=20110618T000000Z;INTERVAL=1;BYDAY=TH,SA'
    WHERE [Subject] = 'Howdy Recurr Test'
    -- Results from UPDATE above do not work in Radscheduler:
    -- DTSTART:20110317T160000Z  DTEND:20110317T170000Z  RRULE:FREQ=WEEKLY;UNTIL=20110618T000000Z;INTERVAL=1;BYDAY=TH,SA
    -- DTSTART:20110317T160000Z  DTEND:20110317T170000Z  RRULE:FREQ=WEEKLY;UNTIL=20110618T000000Z;INTERVAL=1;BYDAY=TH,SA  
    -- Above us is the rule that DOES work which was created by editing RadScheduler on the webpage. What is the difference?

    There aren't any extraneous spaces that I can find.  Is there something hidden?
    I can send more code but it's pretty easy check and see if I'm off my rocker.  Just create a couple of appointments and use the INSERT or UPDATE in SQL to create the RecurrenceRule on one and on the other edit the recurrence rule on the web page via RadScheduler.  Then switch them around if you start getting the same behavior.  It makes absolutely no sense.  If I couldn't recreate it so regularly, I'd say I was drunk or insane.  As it is, I need another system to validate what's happening or find out what ridiculous mistake I'm making.


  2. Peter
    Peter avatar
    6637 posts

    Posted 24 Sep 2010 Link to this post

    Hello Don,

    Thank you for the detailed explanation and thinking you have done about this scenario.

    It is important that the recurrence rule is saved in the database along with the new lines like this:

    DTEND:20110317T170000Z  RRULE:FREQ=WEEKLY;UNTIL=20110618T000000Z;INTERVAL=1;BYDAY=TH,SA'

    If you need to insert this string from code-behind you should denote the new lines in the recurrence string with "/r/n":


    Please, let me know if this was helpful.

    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top