First of all you have to have some way of relating table1 to table2. You have given no name to the column in table1 (I assume from context that it represents a quantity). You'd have to include an ID column to associate the quantity to an ID.
Also, you should not use DESC as a column name. In some database systems this is a reserved word (indicates a descending order for sorting). Once you have two tables set up as
Temp
ID
QTY
Purchases
ID
DESCR
QTY
You can add Temp to Purchases in a query by
select p1.ID, p1.DESCR, QTY=p1.QTY+p2.QTY
from Purchases p1, Temp p2
where p1.ID=p2.ID
This will return the results you want in a recordset for display. Note - this does not update the Purchases database. To create a new table from the results do
select p1.ID, p1.DESCR, QTY=p1.QTY+p2.QTY
into NewPurchases
from Purchases p1, Temp p2
where p1.ID=p2.ID
Reverend Jim
Illigitimae non carborundum
3,743 posts since Aug 2010
Reputation Points: 585
Solved Threads: 470
Skill Endorsements: 33
I have no experience using DataSets, DataAdapters, DataTables, etc so I can't offer any help on how to bind a DataGridView to a database table. I've only ever used ADO and ADO.NET for database operations. I don't like all the layers of abstraction.
Reverend Jim
Illigitimae non carborundum
3,743 posts since Aug 2010
Reputation Points: 585
Solved Threads: 470
Skill Endorsements: 33