i have two datagridviews(first one called Dgv_Invoice,and 2nd called dgv_costCenter)
the data in the second datagridview(dgv_costCenter) was
item name price quantity value customerid
keyboard 20 10 200 1
mouse 10 10 100 2
monitor 200 2 400 3
keyboard 20 5 100 4
mouse 10 5 50 5
keyboard 20 7 140 6
mouse 10 7 70 7
what i want to do is to show items in the first datagridview(Dgv_Invoice) like that
item name price quantity value
keyboard 20 22 440
mouse 10 22 220
monitor 200 2 400
What I have tried:
i have create table inside my database called (items_transactions)
and the to solve this problem i made a query to save data from dgv_costCenter
with stored Procedure and then i call the data to show inside Dgv_Invoice grouped by itemname
select itemname,price,sum(quantity)as totalquantity from items_transactions group by itemname,price,quantity . the problem is that i want to do that inside my form without save (dgv_costCenter) into database and call data again to show inside(Dgv_Invoice) with query .. can any one help me.