Posted on 2011-10-19
Last Modified: 2012-05-12
Hi we're merging a dataset into another using the Merge function

Having problems with the new dataset not going back to the table. If we change a record in a row in the GridEx(like a DataGrid) manually, it only update that row and not the ones changes in sql. Can anyone guess why?

This is my code. Assume it's something to do with AcceptChanges. GridEx is a 3rd party control similar to a DataGrid

        'This merges the temp filtered Dataset table with the original so overwriting

        dsSQLAlarmRenewalManager.Tables(0).Merge(dsTempFiltered.Tables(0), False)

        'Must do this save very first thing

Know it's a bit vague, but just need a break on this!
Question by:StuartK

    Author Comment

    Is it connected to .AcceptChangesDuringFill?
    LVL 20

    Accepted Solution

    You need to do a .Update before .AcceptChanges:


    You're accepting the changes first, which clears all the flags that indicate which rows are added or modified.

    Author Comment

    Thanks for your post. Been reading a bit more up on this, and when we merge it doesn't change the flags for Update to "Modified"

    This is why we are getting anything to update cause the Update Command does't think there is anything

    Apparently we need to set AcceptChangesDuringFilll = False. This chnages all the flags to Modified.

    Would you say this is heading down the right lines? Still not got this sorted.

    Tried AcceptChanges after Update, unfortunately it didn't work!

    Author Closing Comment

    Had to close off. Lost my focus on this apologies all round! Given points just for replying. Thank you ever so much for that!

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now