从后端访问会话数据源
Accsess SessionDataSource from back end
我有来自 this link 的以下代码,用于实现 Gantt chart
。这对我来说是一种新的编码方法。我怎样才能从后端使用相同的东西?或者是否有可能与 MySQL
一起使用?我正在使用 mysql 数据库,因此它对我不起作用。
<%@ Register TagPrefix="sds" Namespace="Telerik.Web.SessionDS" %>
.......
<sds:SessionDataSource ID="TasksDataSource" runat="server" DisplayWarning="false"
PrimaryKeyFields="ID" ProviderName="System.Data.SqlClient"
ConnectionString="<%$ ConnectionStrings:TelerikConnectionString %>"
DeleteCommand="DELETE FROM [GanttTasks] WHERE [ID] = @ID"
InsertCommand="INSERT INTO [GanttTasks] ([ParentID], [OrderID], [Title], [Start], [End], [PercentComplete], [Expanded], [Summary]) VALUES (@ParentID, @OrderID, @Title, @Start, @End, @PercentComplete, @Expanded, @Summary)"
SelectCommand="SELECT * FROM [GanttTasks]"
UpdateCommand="UPDATE [GanttTasks] SET [ParentID] = @ParentID, [OrderID] = @OrderID, [Title] = @Title, [Start] = @Start, [End] = @End, [PercentComplete] = @PercentComplete, [Expanded] = @Expanded, [Summary] = @Summary WHERE [ID] = @ID">
<DeleteParameters>
<asp:Parameter Name="ID" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="ParentID" Type="Int32" />
<asp:Parameter Name="OrderID" Type="Int32" />
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Start" Type="DateTime" />
<asp:Parameter Name="End" Type="DateTime" />
<asp:Parameter Name="PercentComplete" Type="Decimal" />
<asp:Parameter Name="Expanded" Type="Boolean" />
<asp:Parameter Name="Summary" Type="Boolean" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="ParentID" Type="Int32" />
<asp:Parameter Name="OrderID" Type="Int32" />
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Start" Type="DateTime" />
<asp:Parameter Name="End" Type="DateTime" />
<asp:Parameter Name="PercentComplete" Type="Decimal" />
<asp:Parameter Name="Expanded" Type="Boolean" />
<asp:Parameter Name="Summary" Type="Boolean" />
<asp:Parameter Name="ID" Type="Int32" />
</UpdateParameters>
</sds:SessionDataSource>
SessionDataSource 控件是专为 Telerik AJAX 演示站点构建的自定义控件。将其替换为 asp:SqlDataSource 等常规声明性数据源,您应该已设置好。只需删除 PrimaryKeyFields 和 DisplayWarning 属性,因为它们不是标准 .NET 的一部分 类.
我有来自 this link 的以下代码,用于实现 Gantt chart
。这对我来说是一种新的编码方法。我怎样才能从后端使用相同的东西?或者是否有可能与 MySQL
一起使用?我正在使用 mysql 数据库,因此它对我不起作用。
<%@ Register TagPrefix="sds" Namespace="Telerik.Web.SessionDS" %>
.......
<sds:SessionDataSource ID="TasksDataSource" runat="server" DisplayWarning="false"
PrimaryKeyFields="ID" ProviderName="System.Data.SqlClient"
ConnectionString="<%$ ConnectionStrings:TelerikConnectionString %>"
DeleteCommand="DELETE FROM [GanttTasks] WHERE [ID] = @ID"
InsertCommand="INSERT INTO [GanttTasks] ([ParentID], [OrderID], [Title], [Start], [End], [PercentComplete], [Expanded], [Summary]) VALUES (@ParentID, @OrderID, @Title, @Start, @End, @PercentComplete, @Expanded, @Summary)"
SelectCommand="SELECT * FROM [GanttTasks]"
UpdateCommand="UPDATE [GanttTasks] SET [ParentID] = @ParentID, [OrderID] = @OrderID, [Title] = @Title, [Start] = @Start, [End] = @End, [PercentComplete] = @PercentComplete, [Expanded] = @Expanded, [Summary] = @Summary WHERE [ID] = @ID">
<DeleteParameters>
<asp:Parameter Name="ID" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="ParentID" Type="Int32" />
<asp:Parameter Name="OrderID" Type="Int32" />
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Start" Type="DateTime" />
<asp:Parameter Name="End" Type="DateTime" />
<asp:Parameter Name="PercentComplete" Type="Decimal" />
<asp:Parameter Name="Expanded" Type="Boolean" />
<asp:Parameter Name="Summary" Type="Boolean" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="ParentID" Type="Int32" />
<asp:Parameter Name="OrderID" Type="Int32" />
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Start" Type="DateTime" />
<asp:Parameter Name="End" Type="DateTime" />
<asp:Parameter Name="PercentComplete" Type="Decimal" />
<asp:Parameter Name="Expanded" Type="Boolean" />
<asp:Parameter Name="Summary" Type="Boolean" />
<asp:Parameter Name="ID" Type="Int32" />
</UpdateParameters>
</sds:SessionDataSource>
SessionDataSource 控件是专为 Telerik AJAX 演示站点构建的自定义控件。将其替换为 asp:SqlDataSource 等常规声明性数据源,您应该已设置好。只需删除 PrimaryKeyFields 和 DisplayWarning 属性,因为它们不是标准 .NET 的一部分 类.