Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. help me pleeeease to update the avaliable quantity column [modified]

help me pleeeease to update the avaliable quantity column [modified]

Scheduled Pinned Locked Moved Database
databasecsharpsaleshelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nellyvb net
    wrote on last edited by
    #1

    I'm working on an Access DB and the OLEDB data adapter in a VB.net project, I've a windows form in vb.net called Customers orders (partno,name,orderedquantity) When I fill all the texts with it's data Pay attention to the txt of( the ordered quantity ) ,then I press the oreder button which save the entered data to it's table in the DB. How can I make the (avaliablequantity) column in the other table (parts) updates it's selfe according to the ordered quantity. I made an update query in the Access which update the table just when I click on it here it's( . Please help me how can I make the update process work through the following code of the Customerorders . Dim as strcon Try Strcon="provider=Microsoft.jet.oledb.4.0;data source=Sales.mdb" Dim con as new oledbconnection(Strcon) Con.open Dim cmd as new oledb command cmd.commandtext=" insert into parts (orderno,partno,orderedquantity)values(" & textbox1.text & "," & textbox2.text & "," & textbox3.text & ")" cmd.executenonqeur con.close catch exp as exception msgbox(exp.tostring) end try with thanx -- modified at 9:35 Saturday 10th June, 2006

    M 1 Reply Last reply
    0
    • N nellyvb net

      I'm working on an Access DB and the OLEDB data adapter in a VB.net project, I've a windows form in vb.net called Customers orders (partno,name,orderedquantity) When I fill all the texts with it's data Pay attention to the txt of( the ordered quantity ) ,then I press the oreder button which save the entered data to it's table in the DB. How can I make the (avaliablequantity) column in the other table (parts) updates it's selfe according to the ordered quantity. I made an update query in the Access which update the table just when I click on it here it's( . Please help me how can I make the update process work through the following code of the Customerorders . Dim as strcon Try Strcon="provider=Microsoft.jet.oledb.4.0;data source=Sales.mdb" Dim con as new oledbconnection(Strcon) Con.open Dim cmd as new oledb command cmd.commandtext=" insert into parts (orderno,partno,orderedquantity)values(" & textbox1.text & "," & textbox2.text & "," & textbox3.text & ")" cmd.executenonqeur con.close catch exp as exception msgbox(exp.tostring) end try with thanx -- modified at 9:35 Saturday 10th June, 2006

      M Offline
      M Offline
      mr_12345
      wrote on last edited by
      #2

      You will need to run another query to update that table "update available_parts set quantity = quantity - " & textbox3.text & " where partno = " & textbox2.text You should really look into using parameterized queries. Also rename textbox1, 2, 3 to something more meaningful.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups