Hi
I'm using the Reorderlist ajax control to reorder a list of items, this works PERFECTLY by using an sqldatasource with the reorderlist untill I add a WHERE clause to the SELECT statement, then nothing gets saved to the database. Any thoughts on why? or how I can make it work....I need a where clause since I have lots of independent lists inside this one table ( one list for each user).
Here is the code for the sqldatasource.....the one that works....and the one with the where clause that does not work. Nothing else gets changed.
WORKS...
<
asp:SqlDataSource ID="LocalServer" runat="server" ConnectionString="Data Source=MySQLServer;Initial Catalog=MyDatabase;User ID=admin;Password=admin"
SelectCommand="SELECT [WishID], [WishDescription], [WishOrder], [WishParentID] FROM [WishList] ORDER BY [WishOrder]"
UpdateCommand="UPDATE [WishList] SET [WishDescription] = @WishDescription, [WishOrder] = @WishOrder WHERE [WishID] = @WishID">
<UpdateParameters>
<asp:Parameter Name="WishDescription" Type="String" />
<asp:Parameter Name="WishOrder" Type="Int32" />
<asp:Parameter Name="WishID" Type="Object" />
<asp:Parameter Name="WishParentID" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
DOES NOT WORK...
<
asp:SqlDataSource ID="LocalServer" runat="server" ConnectionString="Data Source=MySQLServer;Initial Catalog=MyDatabase;User ID=admin;Password=admin"
SelectCommand="SELECT [WishID], [WishDescription], [WishOrder], [WishParentID] FROM [WishList] WHERE [WishParentID] = @WishParentID ORDER BY [WishOrder]" UpdateCommand="UPDATE [WishList] SET [WishDescription] = @WishDescription, [WishOrder] = @WishOrder, [WishParentID] = @ParentID WHERE [WishID] = @WishID">
<SelectParameters>
<asp:Parameter Name="WishParentID" Type="int32" DefaultValue="77" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="WishDescription" Type="String" />
<asp:Parameter Name="WishOrder" Type="Int32" />
<asp:Parameter Name="WishID" Type="Object" />
<asp:Parameter Name="WishParentID" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
This is killing me......if you have any suggestions I would appriciate them very much.
Nuwanda
You learn from experience, everything else is just information.