Add object to context without savechanges (VB.Net & Entity Framwork) RRS feed

  • Question

  • Hi
    I have a win form (VB.Net) that include a DGV. this DGV populate by Entity Framework as good as passable. But when i try to add some new records to DGV from a Text Box, new records don't show in DGV until I save changes to database!?

    How can I add my required new records to context and see them immediately in DGV then save all of them to database?

    Any help will be greatly appreciated.

    Tuesday, June 4, 2013 5:39 PM


  • Hi,

    See http://msdn.microsoft.com/en-us/data/jj682076.aspx

    It shows how to bind to an EF source that automatically notify its subscribers about changes (if the subscriber is a control, it allows the control to know when he should refresh itself).

    Please always mark whatever response solved your issue so that the thread is properly marked as "Answered".

    • Marked as answer by Chester Hong Sunday, June 23, 2013 4:03 PM
    Tuesday, June 4, 2013 5:57 PM