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

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

4 Answers 134 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
envy kok
Top achievements
Rank 1
envy kok asked on 20 Nov 2011, 06:54 AM
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>

4 Answers, 1 is accepted

Sort by
0
envy kok
Top achievements
Rank 1
answered on 23 Nov 2011, 02:09 AM
Can anyone give me some idea about the above problem? 
Wait on line.
0
Ivana
Telerik team
answered on 23 Nov 2011, 01:15 PM
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
0
envy kok
Top achievements
Rank 1
answered on 23 Nov 2011, 06:05 PM
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?
0
Ivana
Telerik team
answered on 28 Nov 2011, 02:57 PM
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
Tags
Scheduler
Asked by
envy kok
Top achievements
Rank 1
Answers by
envy kok
Top achievements
Rank 1
Ivana
Telerik team
Share this question
or