Scheduler saving appointment only after going to options

3 posts, 1 answers
  1. Sapandeep
    Sapandeep avatar
    12 posts
    Member since:
    Jan 2012

    Posted 07 Dec 2016 Link to this post

    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. Answer
    Anton
    Admin
    Anton avatar
    81 posts

    Posted 12 Dec 2016 Link to this post

    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.
  3. Sapandeep
    Sapandeep avatar
    12 posts
    Member since:
    Jan 2012

    Posted 12 Dec 2016 Link to this post

    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>

Back to Top