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

  • Home
  • SEARCH
  • 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 7730245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:10:38+00:00 2026-06-01T06:10:38+00:00

I have a Windows Mobile 6.0 application with SQL Server CE 3.5 on the

  • 0

I have a Windows Mobile 6.0 application with SQL Server CE 3.5 on the device. The program gets the latest data from the publisher – SQL Server 2008. The replication is working fine but I want to display to the user the last time it replicated from the server.

Does anyone know where I can get the SQL that I can execute on the device to get this information from the SQL Server CE?

All help greatly appreciated.

Mike

  • 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. Editorial Team
    Editorial Team
    2026-06-01T06:10:39+00:00Added an answer on June 1, 2026 at 6:10 am
        /// <summary>
        /// Get the local Datetime for last succesful synchronization
        /// If no Synchronization has happened, will return DateTime.MinValue
        /// </summary>
        /// <param name="connection">An open connection to the local database</param>
        /// <returns>The date and time for the last succesful sync</returns>
        public DateTime GetLastSuccessfulSyncTime(SqlCeConnection connection)
        {
            if (!System.IO.File.Exists(connection.Database))
                return DateTime.MinValue;
    
            if (connection.State != System.Data.ConnectionState.Open)
            {
                connection.Open();
            }
    
            var props = GetPropertiesFromSettings();
    
            using (SqlCeCommand cmd = connection.CreateCommand())
            {
                cmd.Connection = connection;
    
                cmd.CommandText = "SELECT table_name FROM information_schema.tables WHERE TABLE_NAME = @table";
                cmd.Parameters.Add("@table", SqlDbType.NVarChar, 4000);
                cmd.Parameters["@table"].Value = "__sysMergeSubscriptions";
                object obj = cmd.ExecuteScalar();
    
                if (obj == null)
                    return DateTime.MinValue;
                cmd.Parameters.Clear();
    
                cmd.CommandText = "SELECT LastSuccessfulSync FROM __sysMergeSubscriptions " +
                    "WHERE Publisher=@publisher AND PublisherDatabase=@database AND Publication=@publication";
    
                cmd.Parameters.Add("@publisher", SqlDbType.NVarChar, 4000);
                cmd.Parameters["@publisher"].Value = props.Publisher;
    
                cmd.Parameters.Add("@database", SqlDbType.NVarChar, 4000);
                cmd.Parameters["@database"].Value = props.PublisherDatabase;
    
                cmd.Parameters.Add("@publication", SqlDbType.NVarChar, 4000);
                cmd.Parameters["@publication"].Value = props.Publication;
    
                obj = cmd.ExecuteScalar();
                if (obj == null)
                    return DateTime.MinValue;
                else
                    return ((DateTime)obj);
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have windows mobile application that display information from an sql server ce. Normally
I'm uploading a SQL Server CE compact database file from a Windows Mobile application
I have a windows mobile application that sends data via WCF to a server.
I have a .net 3.5 application running on windows mobile professional that uses sql
I have a windows mobile 5.0 application (smartphone) that contains a flat data file
I have to create an application using a Datalogic mobile device that uses Windows
I'm developing a Windows Mobile WinForm application that uses Sql Server CE 3.1 with
I have a Windows mobile 6 application.When a new patch is Available on server
I have the following problem: I implemented a managed mobile application for Windows Mobile
I have an game application I have written for Windows Mobile and I want

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.