• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 616
  • Last Modified:

Reorderlist not working on MySQL using sqldatasource

I want to the reorderlist with a MySQL database using sqldatasource as the connectors. I'd tried it on editting in Gridview, connecting to the same sqldatasource, and it's working (database can be editted).

However using the same sqldatasource, it is not working on the reorderlist (on the webpage, you can reorder the item, but not getting updated in database).

Anything missing from my code attached? Any help is much appreciated.

    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"/>
    <%--reorderlist, after reordering, the database is not being updated--%>
    <cc1:ReorderList ID="ReorderList1" runat="server"
            <asp:Label ID="Label1" runat="server" Text='<% #Eval("name") %>'></asp:Label>
            <asp:Label ID="Label2" runat="server" Text='<% #Eval("order_no") %>'></asp:Label>
            <div style="height: 20px; width: 20px; border: solid 1px black; background-color: Red; cursor: pointer;">
            <div style="width: 300px; height: 20px; border: dotted 2px black;">
    <asp:sqldatasource ID="Sqldatasource1" runat="server"
            ConnectionString="Database=muncchdb;Data Source=localhost;User Id=muncchco;Password=muncchco1;charset=utf8"
            SelectCommand="SELECT id, name, order_no FROM reorder ORDER BY order_no"
            UpdateCommand="update reorder set order_no=?order_no where id=?id">
                <asp:Parameter Name="id" Type="Int32" />
                <asp:Parameter Name="order_no" Type="Int32" />
    <%--The gridview is working, can be editted, to prove that the sqldatasource is called/connected right--%>
    <asp:GridView ID="GridView1" runat="server" DataKeyNames="id" DataSourceID="Sqldatasource1" AutoGenerateEditButton="true">

Open in new window

1 Solution
Bob LearnedCommented:
I don't see where there would be anything that forces the SqlDataSource to call the UpdateCommand.

You can test with the SqlDataSource.Updating event handler:


and, you can manually force an update with the SqlDataSource.Update method.
Sub On_Click(ByVal source As Object, ByVal e As EventArgs)
 End Sub 'On_Click

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now