Results 1 to 6 of 6

Thread: Updating A Database

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2002
    Location
    Lesotho
    Posts
    22

    Updating A Database

    I have text boxes bound to the the dataset on a form. I also have a datagrid. From the datagrid, I'm able to right changes back to the database table using the update method of the the dataadapter. I want to be able to do the same with text boxes bound to the dataset i.e. update database table using the update method of the dataadepter from the changes made at the text boxes bound to the dataset. The program brings no error at all but the table is not updated. Can anybody help???

  2. #2
    New Member
    Join Date
    Dec 2002
    Location
    UK
    Posts
    2
    Are your text boxes bound to the dataset, assuming you've created one as a component in your project already ?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Mar 2002
    Location
    Lesotho
    Posts
    22
    Yes! Text boxes are bound to the dataset. I'm even able to display data from the bound dataset on the text boxes. Problem comes when I want to update!!!

  4. #4
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    doesn't this line update it?

    Code:
    objDataAdapter.update(objDataSet)
    where objDataAdapter is the name of your data adapter and objDataSet is the name of your data set.


    i am new to this so i might be completely wrong!

  5. #5
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Mar 2002
    Location
    Lesotho
    Posts
    22
    Thanx everybody for ur help. It did update only after I added this line of code just before calling update method

    Me.BindingContext(MyDataset.Tables(TableName)).EndCurrentEdit

    I got this from one of the books I'm using

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width