Update multiple records in a dataset

Rattlesnake

Well-known member
Joined
Dec 23, 2003
Messages
47
Hi,
I have ASP.Net 1.1 application.
It contains a form that has a Dataset that contains one table "Orders". It contains the below fields

OrderNumber
OrderDate
OrderSequence

OrderSequence is a sequence number from 1,2,3...........

I display the Orders in a datagrid using Orders dataset as source (Sorted by OrderSequence) .The datagrid contains a Textbox displaying the OrderSequence column.
I am trying to implement a mechanim=sm that will allow the user to change the sequence of the Order to allow him to move the Order up and down the sequence.

When the user changes the OrderSequence , I want to change the OrderSequence in all the Order rows.

For e.g. if the user changes the OrderSequence of a row from "20" to "10" , I want to update the OrderSequence of all rows in the Orders dataset to "OrderSequence + 1" for all those rows that have OrderSequence of 10 or greater.

How can Update multiple records in s Dataset using a sql query ???????????
 
Code:
UPDATE SET OrderSequence = OrderSequence + 1 WHERE OrderSequence > 10 AND ... (other criteria goes here) ...

You should change "10" into a parameter.
 
Sorry. This just come into mind. Are you asking how to update your dataset or how to update your database? I got a little confused with your question. Because updating a dataset and a database is a whole different story.
 
I want to update muliple records in a DATASET.
Eventually this DATASET will be used to update the Database.
But my question is how to update multiple records in a DATASET ???

Thanks
 
I give up. If there is a method to update multiple records in a Dataset then I never knew such method. I always update my Dataset per row. If I want to update multiple rows then Ill be needing a loop. Inside the loop Ill be checking the condition manually then apply the appropriate changes. Sorry for not being any help.
 
Back
Top