Hello,
I'm trying to implement a RadScheduler. I have it all set up with an appointment data source with two resource (room and user) data sources. I autogenerated the insert/update/delete commands for the appointment data source. Whenever I try to create a new appointment I get the following error (even though I only have 9 parameters...):
Here is my Default.aspx code:
Please help me!
Thanks,
Matt
I'm trying to implement a RadScheduler. I have it all set up with an appointment data source with two resource (room and user) data sources. I autogenerated the insert/update/delete commands for the appointment data source. Whenever I try to create a new appointment I get the following error (even though I only have 9 parameters...):
[OleDbException (0x80040e21): Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.]
[InvalidOperationException: Command parameter[9] '' is invalid.
Command parameter[10] '' is invalid.
Command parameter[11] '' is invalid.
]
Telerik.Web.UI.Scheduling.DataSourceViewSchedulerProvider.OnDataSourceOperationComplete(Int32 count, Exception e) +39
System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback) +72
Telerik.Web.UI.Scheduling.DataSourceViewSchedulerProvider.Insert(RadScheduler owner, Appointment appointmentToInsert) +202
Telerik.Web.UI.SchedulerProviderBase.Insert(ISchedulerInfo schedulerInfo, Appointment appointmentToInsert) +70
Telerik.Web.UI.Scheduling.AppointmentController.InsertAppointmentThroughProvider(ISchedulerInfo schedulerInfo, Appointment appointment) +109
Telerik.Web.UI.Scheduling.AppointmentController.InsertAppointment(ISchedulerInfo schedulerInfo, Appointment appointment) +40
Telerik.Web.UI.RadScheduler.InsertAppointmentInline() +303
Telerik.Web.UI.RadScheduler.OnBubbleEvent(Object source, EventArgs args) +505
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +121
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +156
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +9643314
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724
Here is my Default.aspx code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
<
telerik:RadStyleSheetManager
id
=
"RadStyleSheetManager1"
runat
=
"server"
/>
</
head
>
<
body
style
=
"height: 459px"
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
<
Scripts
>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.Core.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQuery.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQueryInclude.js"
/>
</
Scripts
>
</
telerik:RadScriptManager
>
<
script
type
=
"text/javascript"
>
//Put your JavaScript code here.
// Avoid Page_Validators is undefined error.
var Page_Validators = new Array();
</
script
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
</
telerik:RadAjaxManager
>
<
div
>
</
div
>
<
telerik:RadScheduler
ID
=
"RadScheduler1"
runat
=
"server"
DataDescriptionField
=
"Description"
DataEndField
=
"End_Time"
DataKeyField
=
"AppointmentID"
DataRecurrenceField
=
"Recurrence_Rule"
DataRecurrenceParentKeyField
=
"RecurrenceParentID"
DataSourceID
=
"SqlDataSource_Appointment"
DataStartField
=
"Start_Time"
DataSubjectField
=
"Subject"
DayEndTime
=
"19:00:00"
DayStartTime
=
"07:00:00"
StartInsertingInAdvancedForm
=
"True"
WorkDayStartTime
=
"09:00:00"
Height
=
"600px"
SelectedView
=
"MonthView"
>
<
ResourceTypes
>
<
telerik:ResourceType
DataSourceID
=
"SqlDataSource_Resource"
ForeignKeyField
=
"RoomID"
KeyField
=
"ResourceID"
Name
=
"Rooms"
TextField
=
"RoomName"
/>
<
telerik:ResourceType
DataSourceID
=
"SqlDataSource_Employee"
ForeignKeyField
=
"EmployeeID"
KeyField
=
"EmployeeID"
Name
=
"Employees"
TextField
=
"UserName"
/>
</
ResourceTypes
>
<
WeekView
DayStartTime
=
"07:00:00"
WorkDayStartTime
=
"09:00:00"
/>
<
DayView
DayStartTime
=
"07:00:00"
WorkDayStartTime
=
"09:00:00"
/>
<
MultiDayView
DayStartTime
=
"07:00:00"
WorkDayStartTime
=
"09:00:00"
/>
</
telerik:RadScheduler
>
<
asp:SqlDataSource
ID
=
"SqlDataSource_Employee"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:ConnectionString_mgsql2 %>" ProviderName="<%$ ConnectionStrings:ConnectionString_mgsql2.ProviderName %>" SelectCommand="SELECT [EmployeeID], [UserName] FROM [Employee] ORDER BY [UserName]"></
asp:SqlDataSource
>
<
asp:SqlDataSource
ID
=
"SqlDataSource_Appointment"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:ConnectionString_mgsql2 %>" ProviderName="<%$ ConnectionStrings:ConnectionString_mgsql2.ProviderName %>" SelectCommand="SELECT * FROM [Appointment]" DeleteCommand="DELETE FROM [Appointment] WHERE [AppointmentID] = ?" InsertCommand="INSERT INTO [Appointment] ([AppointmentID], [Subject], [Description], [Start], [End], [RoomID], [EmployeeID], [RecurrenceRule], [RecurrenceParentID]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)" UpdateCommand="UPDATE [Appointment] SET [Subject] = ?, [Description] = ?, [Start] = ?, [End] = ?, [RoomID] = ?, [EmployeeID] = ?, [RecurrenceRule] = ?, [RecurrenceParentID] = ? WHERE [AppointmentID] = ?">
<
DeleteParameters
>
<
asp:Parameter
Name
=
"AppointmentID"
Type
=
"Int32"
/>
</
DeleteParameters
>
<
InsertParameters
>
<
asp:Parameter
Name
=
"AppointmentID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"Subject"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"Description"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"Start"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"End"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"RoomID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"EmployeeID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"RecurrenceRule"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"RecurrenceParentID"
Type
=
"Int32"
/>
</
InsertParameters
>
<
UpdateParameters
>
<
asp:Parameter
Name
=
"Subject"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"Description"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"Start"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"End"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"RoomID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"EmployeeID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"RecurrenceRule"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"RecurrenceParentID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"AppointmentID"
Type
=
"Int32"
/>
</
UpdateParameters
>
</
asp:SqlDataSource
>
<
asp:SqlDataSource
ID
=
"SqlDataSource_Resource"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:ConnectionString_mgsql2 %>" ProviderName="<%$ ConnectionStrings:ConnectionString_mgsql2.ProviderName %>" SelectCommand="SELECT * FROM [Resource]"></
asp:SqlDataSource
>
</
form
>
</
body
>
</
html
>
Please help me!
Thanks,
Matt