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. General Programming
  3. Visual Basic
  4. How to update database using values in textboxes

How to update database using values in textboxes

Scheduled Pinned Locked Moved Visual Basic
helpdatabasetutorialannouncement
3 Posts 3 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.
  • M Offline
    M Offline
    Mohit Namdeo
    wrote on last edited by
    #1

    Hello, Can anyone help me to update the database using the values in textboxes. I have successfully written code to add new rows and to delete rows in the database by checking the values in the textboxes on the form. But my problem is that I am unable to update the database similarly. I have created a table in MS-Access named "emp" containing two fields named "name" and "phone" with phone as primary key. On the form I have made two textboxes with their DataBinding text property set for name and phone fields respectively of the dataset. Also I have made a button to load the dataset. And yet another button on which I want to code for updating the database. I have tried many codes but none of them works, when I load the dataset and then make some changes in the text of the textboxes and then click on the update button the respctive database is not updated. If anyone has answer to this problem please inform me with code, this is very urgent and I m facing this problem for many days .

    A M 2 Replies Last reply
    0
    • M Mohit Namdeo

      Hello, Can anyone help me to update the database using the values in textboxes. I have successfully written code to add new rows and to delete rows in the database by checking the values in the textboxes on the form. But my problem is that I am unable to update the database similarly. I have created a table in MS-Access named "emp" containing two fields named "name" and "phone" with phone as primary key. On the form I have made two textboxes with their DataBinding text property set for name and phone fields respectively of the dataset. Also I have made a button to load the dataset. And yet another button on which I want to code for updating the database. I have tried many codes but none of them works, when I load the dataset and then make some changes in the text of the textboxes and then click on the update button the respctive database is not updated. If anyone has answer to this problem please inform me with code, this is very urgent and I m facing this problem for many days .

      A Offline
      A Offline
      albCode
      wrote on last edited by
      #2

      here is simple update command Update emp set name = '" & Textbox1.Text & "' and phone='" & TextBox2.Text & "'"

      1 Reply Last reply
      0
      • M Mohit Namdeo

        Hello, Can anyone help me to update the database using the values in textboxes. I have successfully written code to add new rows and to delete rows in the database by checking the values in the textboxes on the form. But my problem is that I am unable to update the database similarly. I have created a table in MS-Access named "emp" containing two fields named "name" and "phone" with phone as primary key. On the form I have made two textboxes with their DataBinding text property set for name and phone fields respectively of the dataset. Also I have made a button to load the dataset. And yet another button on which I want to code for updating the database. I have tried many codes but none of them works, when I load the dataset and then make some changes in the text of the textboxes and then click on the update button the respctive database is not updated. If anyone has answer to this problem please inform me with code, this is very urgent and I m facing this problem for many days .

        M Offline
        M Offline
        minhnguyen08
        wrote on last edited by
        #3

        Hi!Mohit Namdeo. All steps right but not enough. When you input on textboxs then datas only update on dataset no update on database. so you must do that. here code on button update be sure the connection,dataset,oledb...are created. private sub update_click(...) { oledb.update(dataset) } end sub good luck:rolleyes:

        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