Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i am having a datalist which is having button inside an item template ...
and iam working with command argument for itemid..and populate it in a datatable which inturn is bind to gridview. i am populating datatable when i click on button (through command argument). but if i click on same row that is if same command argument is passed i want to update the datatable specific column values instead of populating the duplicate row in datatable

What I have tried:

i have been trying with alternate ways with the datatable update options but not working.waiting for a favourable reply
Posted
Updated 13-Feb-17 22:33pm

1 solution

Assuming you have a local database instance setup or use local db to get the job done.

Write a SQL command to do an update to a 'Total' table then re-bind to front end controls to show updated value.
e.g.
Table: 'Total'
C#
___________________
|ItemId|Qty|OrderId|
|     1|  2|      1|
|______|___|_______|


SQL:
(I am assuming you are using MS SQL express or something like that)
UPDATE TOTAL SET Qty = @Qty WHERE ItemId = @ItemId AND OrderId = @OrderId.

Pass in some SQL parameters with the '@' prefixed names above and set their values to the new Qty and item/order id.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900