locked
Can not update existing or enter new child record. RRS feed

  • Question

  • Hi,

    I use Visual Studio Community 2015

    I have a master-detail form with Orders and Ordersdetails in a datagrid. I followed the"Walkthrough: saving data from related data tables (Hierarchical Update). So I used the designer and drag- and drop function and the TableAdapterManager.

    When testing I can save new Orders and changes to the master-record Orders.
    When I enter the datagrid with Orderdetails for an existing master record Orders, the Foreign Key of the detail record Orderdetails is set OK.

    But changes to the details record Orderdetails are not saved. Even changes to existing detail records are not saved.

    The datagrid Orderdetails has Enable editing, adding en deleting enabled. I have added the extra line EndEdit for the detailrecord:
    Private Sub ATbOrdersBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles ATbOrdersBindingNavigatorSaveItem.Click

     Me.Validate()    
     Me.AtbOrderlijnenBindingSource.EndEdit()
     Me.ATbOrdersBindingSource.EndEdit()
     Me.TableAdapterManager.UpdateAll(Me.RT2012DataSet)

    end sub

    Please advise

    Monday, April 16, 2018 12:58 PM

All replies

  • Is this SQL-Server or another database?

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Monday, April 16, 2018 1:26 PM

  • La vida loca

    Monday, April 16, 2018 3:52 PM
  • Wim,

    Mostly it is updating but are people looking at the wrong  database file. As this is often used with MS Access or another Database file the problem is mostly that the mysterious property Copy to Output direction is used and set to Copy to Output, change it to do not copy. 


    Success
    Cor


    Monday, April 16, 2018 4:47 PM