|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Update database fieldIf I've two tables with their values:
cars(carNo,name,color,model,existedquantity) 2- CustomerOrders(orderNo,carNo,ordered,orderedquantity,orderdate) I made for each one of them a form by the Windows Form Designer in the vb.net plate to record data through these forms. By the way I'm working on an Access db and on the (imports system.data.oledb provider). How can I make the( existedquantity) column in the "cars" table decreases for each ordered car according to the (orderedquantity) column from the "CustomerOrders"table. Zoneal,
There are thousands answers possible on the way you have made your question. When I look at your question than the most simple answer is. Create an SQL statement that does that and process that using OleDb.OleDBCommand.ExecuteNonQuery If you want it in VB.Net than it is a question of creating Two DataTables. Using a relation Cars -> CustomerOrders and do that action in the parent based on every CustomerOrderRow Child in a For each loop and update the table than again. Be aware that what you are doing is a very riscy operation. Doing this twice will give direct wrong information. It is in my idea better to keep in this case a field ordered Cars in your Car table, count that in the same way starting at zero and than subtract that from your field exisitedquantity giving the economicQuantity (I don't know if this word exist in English). I hope this helps, Cor <zon***@yahoo.com> schreef in bericht Show quoteHide quote news:1149181863.408970.123940@f6g2000cwb.googlegroups.com... > If I've two tables with their values: > cars(carNo,name,color,model,existedquantity) 2- > CustomerOrders(orderNo,carNo,ordered,orderedquantity,orderdate) > > I made for each one of them a form by the Windows Form Designer in the > vb.net plate to record data through these forms. > > By the way I'm working on an Access db and on the (imports > system.data.oledb provider). > > How can I make the( existedquantity) column in the "cars" table > decreases for each ordered car according to the (orderedquantity) > column from the "CustomerOrders"table. >
what's available in WMI
File sitting on a network drive is still open by another applicati Deleted row in dataset?? popup windows killer Why choose SQL Express over Access? "select case" statement optimization in VB and C# problems Soap Formatter namespace not found loading frames asp Synchronize VS2005 Projects directory? My object/class/whatever |
|||||||||||||||||||||||