CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Simple question

  1. #1
    Join Date
    Feb 2003
    Posts
    3

    Simple question

    I'm trying to update a textbox that is bound to a dataset. However, I can't update this by using the textbox1.text property. How can I update this?

  2. #2
    Join Date
    Feb 2003
    Posts
    3
    I figured out how to assign it to the data set but I can't get the data set to update that change in the field to the database. Any help would be really appreciated.

  3. #3
    Join Date
    Jul 2000
    Posts
    70

    More info

    You might have to give some more details.

    I'm assuming you are filling a database with:

    SqlDataAdapter.Fill(myDataSet)
    or
    OleDbDataAdapter.Fill(myDataSet)

    to reflect the changes you need to call

    SqlDataAdapter.Update(myDataSet)
    or
    OleDbDataAdapter.Update(myDataSet)

    The update function takes all change/add/deletes from the dataset and makes them in the database.

    Hope that helps. If not, you'll need to give some more information and possibly show some code.

    DG.

  4. #4
    Join Date
    Feb 2003
    Posts
    3
    Here's the code that I use to update the Field:

    Me.BindingContext(objdsMort, "Mortgage").Current.row.item("Principal") = strNew

    'Then to update the database:

    Me.BindingContext(objdsMort, "Mortgage").EndCurrentEdit()
    objDataSetChanges = CType(objdsMort.GetChanges, AMT.dsMort)
    Me.OleDbConnection1.Open()
    OleDbDataAdapter1.Update(objDataSetChanges)
    Me.OleDbConnection1.Close()
    objdsMort.Merge(objDataSetChanges)
    objdsMort.AcceptChanges()

    I am filling the database with OleDbDataAdapter.Fill(myDataSet).

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

Featured