{"id":15410384,"url":"https://github.com/erikej/sqlcemergelib","last_synced_at":"2025-03-28T02:47:19.213Z","repository":{"id":144130285,"uuid":"86896047","full_name":"ErikEJ/SqlCeMergeLib","owner":"ErikEJ","description":"This library simplifies the code to do Merge Replication from a SQL Server Compact 3.5 SP2 client, with useful helper methods","archived":false,"fork":false,"pushed_at":"2020-05-11T06:43:02.000Z","size":5417,"stargazers_count":2,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-03T14:18:46.162Z","etag":null,"topics":["database","replication","sql-server","sql-server-compact"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ErikEJ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-01T08:03:59.000Z","updated_at":"2023-01-10T23:37:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"93b1926f-c671-4719-85d1-4a618acb203f","html_url":"https://github.com/ErikEJ/SqlCeMergeLib","commit_stats":{"total_commits":37,"total_committers":4,"mean_commits":9.25,"dds":"0.21621621621621623","last_synced_commit":"7ef2953597d96cb2c73ee592a26ab80a39e9cfb7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErikEJ%2FSqlCeMergeLib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErikEJ%2FSqlCeMergeLib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErikEJ%2FSqlCeMergeLib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErikEJ%2FSqlCeMergeLib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ErikEJ","download_url":"https://codeload.github.com/ErikEJ/SqlCeMergeLib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245960653,"owners_count":20700777,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","replication","sql-server","sql-server-compact"],"created_at":"2024-10-01T16:44:13.510Z","updated_at":"2025-03-28T02:47:19.186Z","avatar_url":"https://github.com/ErikEJ.png","language":"C#","readme":"# What is it?\n\nThis library simplifies the code to do Merge Replication from a SQL Server Compact 3.5 SP2 client, with useful helper methods\n\nFeatures:\n\n- Is intended for use from a WinForms or WPF application, and the Synchronize method runs async.\n- Implements best practices for optimal performance, and attempt to properly detect expired subscriptions, by throwing a PublicationMayHaveExpiredException. \n- Will create the database file for you as required, so an existing database file is not required.\n- Optionally logs sync status to a SyncLog table (which is a part of the publication)\n- Generate INSERT script in order to rescue local data in case of a disaster (for example publication expiry)\n- Validate a Publication, for example after initial Sync\n- Properly format a SqlCeException as a string to get all available error information\n- Source includes a demo form to test parameters and see the library in action\n- Exposes the settings described in the [Rob Tiffany \"cheat sheet\"](http://robtiffany.com/mobile-merge-replication-performance-and-scalability-cheat-sheet/)\n\n# How do I get it?\n\nDownload the [NuGet package](http://www.nuget.org/packages/ErikEJ.SqlCeMergeLib/)\n\n# How do I use it?\n\n[Online API documentation](https://erikej.github.io/SqlCeMergeLib/)\n\n[Sample WinForms app](https://github.com/ErikEJ/SqlCeMergeLib/blob/master/docs/Sample.zip)\n\n```csharp\nusing ErikEJ.SqlCeMergeLib;\nusing System.Data.SqlServerCe;\n...\nstring sdfFile = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), \"MergeTest.sdf\");\nconn = new SqlCeConnection(string.Format(\"Data Source={0}\", sdfFile));\n\nDateTime syncDate = sync.GetLastSuccessfulSyncTime(conn);\ntextBox1.Text = \"Last Sync: \" + syncDate.ToString();\n\nsync.Completed += SyncCompletedEvent;\nsync.Progress += SyncProgressEvent;\nsync.Synchronize(conn, 1002, 1);\n```\n\nOther useful methods:\n\nGenerate INSERT script for the local database (for disaster recovery):\n```csharp\npublic string GenerateInsertScripts (\n        SqlCeConnection connection,\n        List\u003cstring\u003e tableNames\n) \n```\n\nFormat a SqlCeException as a String:\n```csharp\npublic string ShowErrors (\n        SqlCeException e\n) \n```\n\nValidate that the local database is properly Merge Replicated;\n```csharp\npublic bool Validate (\n        SqlCeConnection connection\n) \n```\n\nConfiguration:\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\" ?\u003e\n\u003cconfiguration\u003e\n  \u003cappSettings\u003e\n    \u003cadd key=\"InternetLogin\" value=\"\"/\u003e\n    \u003cadd key=\"InternetPassword\" value=\"\"/\u003e\n    \u003cadd key=\"InternetUrl\" value=\"http://erik-pc/ssce35sync/sqlcesa35.dll\"/\u003e\n    \u003cadd key=\"Publication\" value=\"PubPostCodes\"/\u003e\n    \u003cadd key=\"Publisher\" value=\"Erik-PC\\SQL2008R2\"/\u003e\n    \u003cadd key=\"PublisherDatabase\" value=\"PostCodes\"/\u003e\n    \u003cadd key=\"PublisherLogin\" value=\"sa\"/\u003e\n    \u003cadd key=\"PublisherPassword\" value=\"pw\"/\u003e\n    \u003cadd key=\"UseNT\" value=\"false\"/\u003e\n  \u003c/appSettings\u003e\n\u003c/configuration\u003e\n```\n![Screenshot](https://github.com/ErikEJ/SqlCeMergeLib/blob/master/img/repl.jpg)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferikej%2Fsqlcemergelib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferikej%2Fsqlcemergelib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferikej%2Fsqlcemergelib/lists"}