|
-
Sep 10th, 2004, 01:17 PM
#1
Thread Starter
New Member
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 atabase 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!!
Last edited by merovatis; Sep 10th, 2004 at 03:52 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|