Rattlesnake Posted February 10, 2007 Posted February 10, 2007 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 ??????????? Quote When you gotta go,you gotta go !!!!!!!
amir100 Posted February 11, 2007 Posted February 11, 2007 UPDATE SET OrderSequence = OrderSequence + 1 WHERE OrderSequence > 10 AND ... (other criteria goes here) ... You should change "10" into a parameter. Quote Amir Syafrudin
Rattlesnake Posted February 12, 2007 Author Posted February 12, 2007 I know the query but how do I run this on a Dataset table???? Quote When you gotta go,you gotta go !!!!!!!
amir100 Posted February 14, 2007 Posted February 14, 2007 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. Quote Amir Syafrudin
Rattlesnake Posted February 14, 2007 Author Posted February 14, 2007 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 Quote When you gotta go,you gotta go !!!!!!!
amir100 Posted February 14, 2007 Posted February 14, 2007 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. Quote Amir Syafrudin
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.