How to make ReurrenceRule work properly when I use SQL Server Datasource

5 posts, 0 answers
  1. envy kok
    envy kok avatar
    6 posts
    Member since:
    May 2010

    Posted 20 Nov 2011 Link to this post

    Hi folks,

    Help! Help!
    I use sql server as RadScheduler datasource. And I define the ReurrenceRule, the detail definition is provided below .
    BUT  my recurrence appointment only shows ONCE (one time only), meaning not recurrence. Please do me a favor. Thank you in advanced.

    Here is My data in sql server database.

    ID Subject Description Start End RecurrenceRule RecurrenceParentID Reminder Annotations TestResourceId
    5 DevMedia conference NULL 2011-11-01 06:30:00.000 2011-11-01 07:30:00.000 DTSTART:20111101T063000Z  DTEND:20111101T073000Z  RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20111120T210000Z;BYDAY=MO,TU,WE,TH,FR;   NULL NULL NULL 3

    My scheduler binding is like
    <telerik:RadScheduler runat="server" ID="RadScheduler1" Skin="Windows7" Height="551px" DataEndField="End" DataKeyField="Id" 
                        DataSourceID="EntityDataSource1" DataStartField="Start" 
                        DataSubjectField="Subject" 
                        DataRecurrenceField="RecurrenceRule" 
                        DataRecurrenceParentKeyField="RecurrenceParentID">
    </telerik:RadScheduler>
                    
                    <asp:EntityDataSource ID="EntityDataSource1" runat="server" 
                        ConnectionString="name=IAppointmentEntities" 
                        DefaultContainerName="IAppointmentEntities" EnableFlattening="False" 
                        EntitySetName="Appointments">
                    </asp:EntityDataSource>
                    <asp:EntityDataSource ID="EntityDataSource2" runat="server" 
                        ConnectionString="name=IAppointmentEntities" 
                        DefaultContainerName="IAppointmentEntities" EnableFlattening="False" 
                        EntitySetName="TestResources">
                    </asp:EntityDataSource>
  2. envy kok
    envy kok avatar
    6 posts
    Member since:
    May 2010

    Posted 22 Nov 2011 Link to this post

    Can anyone give me some idea about the above problem? 
    Wait on line.
  3. Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 23 Nov 2011 Link to this post

    Hello Envy Kok,

    I did not manage to reproduce this behavior locally. Attached is the project I have been testing on, you could download it and give it a try locally.

    Hope it is helpful.

    Regards,
    Ivana
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  4. envy kok
    envy kok avatar
    6 posts
    Member since:
    May 2010

    Posted 23 Nov 2011 Link to this post

    Thank you very much. As long as I use the data you provide to me, it works.

    Can you explain a bit more how to insert the data like you provide to me? Because it seems has 3 lines string when I copy outside instead of one line string.

    for example: (when I copy "RecurrenceRule" filed data to notepad, It shows 3 lines)
    DTSTART:20070330T063000Z
    DTEND:20070330T073000Z
    RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20070406T210000Z;BYDAY=MO,TU,WE,TH,FR;

    Instead of 
    DTSTART:20070330T063000Z  DTEND:20070330T073000Z RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20070406T2... 

    Can you provide me a sample SQL SERVER INSERT Statement with data?
  5. Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 28 Nov 2011 Link to this post

    Hello Envy,

    You could refer to the Working with Recurrence Appointments help article, which shows how recurring appointments are added, from code-behind.

    Also, if you want to insert an appointment into the data base, with recurrence rule defined for it, using SQL query,  you could use the following example:
    INSERT INTO Appointments(Subject, Start, [End], UserID, RoomID,  RecurrenceRule,  
             RecurrenceParentID, Annotations, 
          Description, Reminder, LastModified)
    VALUES ('test rrule', '2011-11-28', '2011-11-28 00:00:00', 1, 
      NULL
    ,'DTSTART:20111128T083000Z DTEND:20111128T093000Z
          RRULE:FREQ=WEEKLY;UNTIL=20111201T000000Z;INTERVAL=1;BYDAY=MO,TU,WE'
      NULL
    , NULL, NULL, NULL, NULL)
    When you insert a RecurrenceRule value make sure that there are no new lines or double spaces left. The value should be just as in the example above. 

    As for the RecurrenceRule presentation as a three-line string on pasting, it probably depends on the environment where you are pasting the string.

    I hope this helps.

    Greetings,
    Ivana
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top