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 540275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:13:25+00:00 2026-05-13T10:13:25+00:00

We are converting our application from using Sql Server Express (let’s call this version

  • 0

We are converting our application from using Sql Server Express (let’s call this version 3) to Sql Server Compact Edition (let’s call this version 4). I am trying to make sure that upgrades from previous versions (versions 1 and 2) are the same in the new product (version 4) as the old (version 3). The upgrade code had to be rewritten for various reasons.

I’m creating a quick test application that will compare a version 3 Sql Server Express database and a version 4 Sql CE database. If the conversion logic is good, the databases should be exactly equivalent–same tables, same columns, same row values.

It would seem to me that there should be an easy way to do this using DataTable.Merge and DataTable.GetChanges, but I’m not having success. If rows exist in the version 3 database and not in the version 4 database, the GetChanges still returns null. If there are changes to the same rows (based on the primary key, which is a Guid), GetChanges still returns null.

string selectSql = String.Format("SELECT {0} FROM {1}", String.Join(", ", columns.ToArray()), tableName);

var expressAdapter = new SqlDataAdapter(selectSql, expressConnection);
DataTable expressTable = new DataTable();
expressAdapter.Fill(expressTable);
expressTable.PrimaryKey = new DataColumn[] { expressTable.Columns[tableName + "ID"] };

SqlCeConnection ceConnection = new SqlCeConnection(this.SqlServerCeConnectionString);
var ceAdapter = new SqlCeDataAdapter(selectSql, ceConnection);
DataTable ceTable = expressTable.Clone();
ceAdapter.Fill(ceTable);

expressTable.Merge(ceTable);
return expressTable.GetChanges(); // this is null even when the expressTable has rows that do not exist in ceTable.

Am I using Merge and GetChanges in a way too far removed from their intended use? If so, other options would be welcome.

  • 1 1 Answer
  • 1 View
  • 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. Editorial Team
    Editorial Team
    2026-05-13T10:13:25+00:00Added an answer on May 13, 2026 at 10:13 am

    I tried to do something similar sometime ago, but eventually it didn’t work, because AcceptChanges was called on rows added by Merge, so they were all in unmodified state, so GetChanges returned null…

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

Sidebar

Related Questions

I'm converting one of our ASP.NET MVC application from 1.0 to 2.0. This is
I'm currently converting our company database application from VB to ASP.NET. This is pretty
Our shop is in the process of converting our internal project management application from
I am soon going to be converting my part of an application from using
I'm currently trying to upgrade our build server at work, going from having no
I am converting an application from BDE to ADO. Under the BDE, if a
In my application, we need to display the Video frame receives from server to
I'm migrating from SQL Server to PostgreSQL. I've seen from How to declare a
Our IT department recently moved from our databases to a cluster. This move broke
Our application uses bunch of WMI calls. When using guest account connecting to local

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.