Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 47909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:11:48+00:00 2026-05-10T16:11:48+00:00

What is the best approach to synchronizing a DataSet with data in a database?

  • 0

What is the best approach to synchronizing a DataSet with data in a database? Here are the parameters:

  • We can’t simply reload the data because it’s bound to a UI control which a user may have configured (it’s a tree grid that they may expand/collapse)
  • We can’t use a changeflag (like a UpdatedTimeStamp) in the database because changes don’t always flow through the application (e.g. a DBA could update a field with a SQL statement)
  • We cannot use an update trigger in the database because it’s a multi-user system
  • We are using ADO.NET DataSets
  • Multiple fields can change of a given row

I’ve looked at the DataSet’s Merge capability, but this doesn’t seem to keep the notion of an ‘ID’ column. I’ve looked at DiffGram capability but the issue here is those seem to be generated from changes within the same DataSet rather than changes that occured on some external data source.

I’ve been running from this solution for a while but the approach I know would work (with a lot of ineffeciency) is to build a separate DataSet and then iterate all rows applying changes, field by field, to the DataSet on which it is bound.

Has anyone had a similar scenario? What did you do to solve the problem? Even if you haven’t run into a similar problem, any recommendation for a solution is appreciated.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T16:11:48+00:00Added an answer on May 10, 2026 at 4:11 pm

    DataSet.Merge works well for this if you have a primary key defined for each DataTable; the DataSet will raise changed events to any databound GUI controls

    if your table is small you can just re-read all of the rows and merge periodically, otherwise limiting the set to be read with a timestamp is a good idea – just tell the DBAs to follow the rules and update the timestamp 😉

    another option – which is a bit of work – is to keep a changed-row queue (timestamp, row ID) using a trigger or stored procedure, and base the refresh queries off of the timestamp in the queue; this will be more efficient if the base table has a lot of rows in it, allowing you (via an inner join on the queue record) to pull only the changed rows since the last poll time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 76k
  • Answers 76k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Damn - found my own answer. All masterpages in the… May 11, 2026 at 3:02 pm
  • added an answer You didn't say whether you actually ever added source files… May 11, 2026 at 3:02 pm
  • added an answer Could you do this? Dictionary<YourEnum, int> dic = new Dictionary<YourEnum,… May 11, 2026 at 3:02 pm

Related Questions

What is the best approach to define additional data for typedef enums in C?
What is the best approach to calculating the largest prime factor of a number?
What is the best approach to releasing a new version of a hosted web
What is the best approach to implementing authorisation/authentication for a Windows Forms app talking

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.