Simple update query question
Hi programmers!
i have a Truedbgrid that has three columns : Productname, howmany and totalprice. (the table is ordereddatails)
at column productname i use a dropdownlist from table products, no problem with that. at column howmany i give the number of products that i want.
THE PROBLEM: In the third column totalprice i have the calculation of the column howmany with the price of the current product at table Products.
QUESTION: I there any way i can do the calculation using the Truedbgrid ColumnProperties or i have to run a query using a button that updates the table orderdatails? im writing my update code which is wrong (im new, sorryyyy!!!)
im using Jet Oledb
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=""C:\products\products.mdb"";Jet OLEDB:Database Password=")
conn.Open()
Dim ds As New DataSet
' select the products based on klados of order
Dim sqlstring As String = "update orderdatails SET orderdatails.cost = orderdatails.posotita * products.timh where products.codeprod = orderdatails.codeproduct"
dataAdapter = New OleDbDataAdapter(sqlstring, conn)
'dataAdapter.Fill(ds, "productlist")
dataAdapter.UpdateCommand.ExecuteNonQuery()
conn.Close()
i'm trying to update the table of database
thanks!!