CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2003
    Posts
    95

    [RESOLVED] EndEdit Doesn't Add Record!

    Ok... this is driving me nuts.

    I have a DataGridView that loads an Access database when the application starts. I also have a bunch of text boxes that are bound to the same database. When you click on a row in the DataGridView the text boxes display the data for the record you clicked on.. perfect so far... now when I want to add a new record..

    I do...

    BindingSource.AddNew()

    This removes all the data from the textboxes and I start typing away.

    When im done I hit a Save button with the following code.

    BindingSource.EndEdit()

    It removes all the data from the text boxes but never saves to the database! What am I doing wrong?
    Last edited by fallnwrld; August 29th, 2009 at 05:51 AM.
    Using VB .Net 2008 Express Edition

  2. #2
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: EndEdit Doesn't Add Record!

    .Update ?

  3. #3
    Join Date
    Mar 2003
    Posts
    95

    Re: EndEdit Doesn't Add Record!

    BindingSource doesn't have have an .update option?
    Using VB .Net 2008 Express Edition

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: EndEdit Doesn't Add Record!

    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Mar 2003
    Posts
    95

    Re: EndEdit Doesn't Add Record!

    Thanks that post helped. I was manually trying to bind them instead of just dragging and dropping the controls from the dataset onto the form.
    Using VB .Net 2008 Express Edition

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