Databound Reorder Control and Oracle 10g DB - Not Updateable

Last post 04-09-2008 4:01 PM by John Happy. 0 replies.

Sort Posts:

  • Databound Reorder Control and Oracle 10g DB - Not Updateable

    04-09-2008, 4:01 PM
    • Member
      23 point Member
    • John Happy
    • Member since 11-03-2006, 3:19 AM
    • Posts 34

    I'm using VS 2005 to develop a web app and would like to use the Ajax Reorder control.

    I want to use an Oracle db table, rather than MS SQL Server db table, as the SQLDataSource for the control.

    I can get a Reorder control to work using a MS SQL Server db table hooked up to a SQLDataSource control. The select statement obviously works and the update code updates the SortOrderField as it should: http://www.lowfatcow.com/SQLServerReorder.aspx

    I am unable to get my databound Reorder control to effect an update using my Oracle 10g (Express Edition) when hooked up to a SQLDataSource control: http://www.lowfatcow.com/OracleReorder.aspx

    If you follow the link to my OracleReorder.aspx page, you will see the database table data within the Reorder control - the SQLDataSource SELECT statement works - but attempting to reorder the list (and UPDATE the Oracle db table) results in an error. The error message says that the data source could not be reordered and it does not implement IList.

    The SQL Server 2005 and Oracle 10g database tables have the same column names, the appropriate data types and the same data.

    Have you had any success getting a Reorder control to do a db table update with an Oracle database and a SQLDataSource control?

    Following is the OracleReorder code:

    Connection String in the Web.config file:   

    <add name="BDLOracleConnectionString" connectionString="Data Source=xxx.xxx.x.xx/XE;User ID=xxx;Password=xxxxxxx;Unicode=True" providerName="System.Data.OracleClient" />

    Reorder Control Code:

    <cc1:ReorderList ID="ReorderList1" runat="server" AllowReorder="true" CssClass="ReOrderControlStyle" DataKeyField="CATEGORYID" DataSourceID="SqlDataSource1" DragHandleAlignment="left" SortOrderField="PRIORITY" >

    <ItemTemplate>

    <asp:Label id="lblCategoryName" runat="server" Text='<%# Eval("CATEGORYNAME") %>'></asp:Label>

    </ItemTemplate>

     

    </cc1:ReorderList>

    SQLDataSource code:

    <asp:SqlDataSource ID="SqlDataSource1" runat="server"

    ConnectionString="<%$ ConnectionStrings:BDLOracleConnectionString %>"

    OldValuesParameterFormatString="original_{0}"

    ProviderName="<%$ ConnectionStrings:BDLOracleConnectionString.ProviderName %>"

    SelectCommand='SELECT * FROM "REORDER" ORDER BY "PRIORITY"'

    UpdateCommand='UPDATE "REORDER" SET "PRIORITY" = :PRIORITY WHERE "CATEGORYID" = :original_CATEGORYID'>

    <UpdateParameters>

    <asp:Parameter Name="PRIORITY" Type="Decimal" />

    <asp:Parameter Name="original_CATEGORYID" Type="Decimal" />

    </UpdateParameters>

    </asp:SqlDataSource>

    ***************************************************************

    Following is the SQLServerReorder Code:

    Connection String in the Web.Config file:

    <add name="SQLServerBDLConnectionString" connectionString="Data Source=xxxxx;Initial Catalog=xxx;User ID=sa;Password=xxxx" providerName="System.Data.SqlClient" />

    Reorder Control Code:

    <cc1:ReorderList ID="ReorderList1" runat="server" AllowReorder="true" CssClass="ReOrderControlStyle" DataKeyField="CategoryID" DataSourceID="SqlDataSource1" DragHandleAlignment="left" ItemInsertLocation="beginning" SortOrderField="Priority">

     

    <ItemTemplate>

    <asp:Label ID="lblCategoryName" runat="server" Text='<%# Eval("CategoryName") %>' />

    </ItemTemplate>

    </cc1:ReorderList>

    SQLDataSource Code:

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SQLServerBDLConnectionString %>"

    SelectCommand="SELECT * FROM [Reorder] ORDER BY [Priority]"

    UpdateCommand="UPDATE [Reorder] SET [Priority] = @Priority WHERE [CategoryID] = @original_CategoryID"

    OldValuesParameterFormatString="original_{0}" >

    <UpdateParameters>

    <asp:Parameter Name="Priority" Type="Int32" />

    <asp:Parameter Name="original_CategoryID" Type="Int32" />

    </UpdateParameters>

     

    </asp:SqlDataSource>

    ************************************************

    On both the SQLServer and Oracle web pages the Reorder control display correctly. The select statements generate the list items within the Reorder controls.

    On the OracleReorder page the list items will move, but they snap back to their original position when the mouse button is released and the error dialog appears.

    Perhaps the Oracle 10g database is simply not compatable with the Reorder and SQLDataSource controls and no amount of code tweeking will work?

     

Page 1 of 1 (1 items)