从后端访问会话数据源

时间:2015-01-04 04:30:38

标签: mysql sql asp.net vb.net telerik

我有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>

1 个答案:

答案 0 :(得分:0)

SessionDataSource控件是仅为Telerik AJAX演示站点构建的自定义控件。将其替换为常规声明性数据源(如asp:SqlDataSource),您应该进行设置。只需删除PrimaryKeyFields和DisplayWarning属性,因为它们不属于标准.NET类。