Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 ???????????

When you gotta go,you gotta go !!!!!!!
Posted

UPDATE SET OrderSequence = OrderSequence + 1 WHERE OrderSequence > 10 AND ... (other criteria goes here) ...

 

You should change "10" into a parameter.

Amir Syafrudin
Posted
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.
Amir Syafrudin
Posted

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

When you gotta go,you gotta go !!!!!!!
Posted
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 I'll be needing a loop. Inside the loop I'll be checking the condition manually then apply the appropriate changes. Sorry for not being any help.
Amir Syafrudin

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...