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

Scheduler saving appointment only after going to options

2 Answers 93 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Sapandeep
Top achievements
Rank 1
Sapandeep asked on 07 Dec 2016, 06:41 PM

Hi ,

 

I am radscheduler using Sql data source method.

<telerik:RadAjaxPanel ID="ajaxpanel1" runat="server">
<telerik:RadScheduler Width="940px" runat="server" ID="ASIScheduler" DataDescriptionField="Description"
DataEndField="End" DataRecurrenceParentKeyField="RecurrenceParentID" DataRecurrenceField="RecurrenceRule"
DataKeyField="ID" DataReminderField="Reminder" DataSourceID="SqlDataSource1"
DataStartField="Start" DataSubjectField="Subject"
EnableDescriptionField="True" Height="700px"
SelectedView="MonthView" OnAppointmentDataBound="ASIScheduler_AppointmentDataBound">
<Reminders Enabled="True" />
</telerik:RadScheduler>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DevConnString %>"
SelectCommand="SELECT [ID], [Subject], [start], [End], [RecurrenceRule], [RecurrenceParentID], [Reminder], [Description], [Annotations] FROM [EventCalendar]"
DeleteCommand="DELETE FROM [EventCalendar] WHERE [ID] = @ID" InsertCommand="INSERT INTO [EventCalendar] ([Subject], [Start], [End], [RecurrenceRule], [RecurrenceParentID], [Description],[Reminder]) VALUES (@Subject, @Start, @End, @RecurrenceRule, @RecurrenceParentID, @Description, @Reminder)"
UpdateCommand="UPDATE [EventCalendar] SET [Subject] = @Subject, [Start] = @Start, [End] = @End, [RecurrenceRule] = @RecurrenceRule, [RecurrenceParentID] = @RecurrenceParentID, [Description] = @Description WHERE [ID] = @ID"></asp:SqlDataSource>
</telerik:RadAjaxPanel>

When user tries to add new appointment  , we are getting following error

Must declare the scalar variable "@Description".

 

but when user clicks new appointment and then click on "options" and fill in other details then appointment gets saved.

 

Please advise fix for this.

2 Answers, 1 is accepted

Sort by
0
Accepted
Anton
Telerik team
answered on 12 Dec 2016, 07:24 AM
Hi Sapandeep,

I attached you a sample website with a RadScheduler bound to a SQL Data source. As you can see on the video at my side the scheduler is saving an appointment before going to the advanced form.

In order to run the project, add reference to Telerik.Web.UI.dll and Telerik.Web.UI.Skins.dll. Also please place the Telerik.mdf file(you can find it in your Live  Demos folder (C:\Program Files (x86)\Telerik\UI for ASP.NET AJAX R3 2016\Live Demos\App_Data) n the App_Data folder of the project.

Regards,
Anton
Telerik by Progress
Telerik UI for ASP.NET AJAX is ready for Visual Studio 2017 RC! Learn more.
0
Sapandeep
Top achievements
Rank 1
answered on 12 Dec 2016, 02:01 PM

Thanks Anton i was missing parameter mapping , by adding it it resolved the issue. 

<UpdateParameters>

<asp:Parameter Name="ID" Type="Int32"></asp:Parameter>
<asp:Parameter Name="Subject" Type="String"></asp:Parameter>
<asp:Parameter Name="Description" Type="String"></asp:Parameter>
<asp:Parameter Name="Start" Type="DateTime"></asp:Parameter>
<asp:Parameter Name="End" Type="DateTime"></asp:Parameter>
<asp:Parameter Name="RecurrenceRule" Type="String"></asp:Parameter>
<asp:Parameter Name="RecurrenceParentID" Type="Int32"></asp:Parameter>
<asp:Parameter Name="Reminder" Type="String"></asp:Parameter>
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="Subject" Type="String"></asp:Parameter>
<asp:Parameter Name="Description" Type="String"></asp:Parameter>
<asp:Parameter Name="Start" Type="DateTime"></asp:Parameter>
<asp:Parameter Name="End" Type="DateTime"></asp:Parameter>
<asp:Parameter Name="RecurrenceRule" Type="String"></asp:Parameter>
<asp:Parameter Name="RecurrenceParentID" Type="Int32"></asp:Parameter>
<asp:Parameter Name="Reminder" Type="String"></asp:Parameter>
</InsertParameters>

Tags
Scheduler
Asked by
Sapandeep
Top achievements
Rank 1
Answers by
Anton
Telerik team
Sapandeep
Top achievements
Rank 1
Share this question
or