Change order column from listbox RRS feed

  • Question

  • User1083596785 posted


    I'm using VS 2010 asp.net C#

    I want to change the order of rows in database using a listbox and (up, down) buttons. I retrieve 3 columns from DB (ID, Name, Order) then put it in a dataset and bind the (Name) column the listbox. I want to change the order field and pass the new order to database, by selecting a (Name) from the listbox and click the up button must effect 2 rows in database with each button click.

    I want to know how to pass the new (order) to the DB and the stored procedure, and include some code please.

    The order field is int number.


    Monday, January 14, 2013 4:56 AM


  • User3866881 posted

    Change order column from listbox


    Maybe you have to dynamically generate the columns' order in the SQL statement, and then use SqlDataAdapter.Fill into a DataTable and then bind to the GridView.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 15, 2013 9:20 PM