sql server ce - How to synchronize merge subscription in Sql Compact DB (on a Mobile device emulator) -


using SQL ManagementStudio 2008 I have created SQL 3.5 Compact DB (TestCompact.sdf) and I have subscribed to the current publication . Using SQL Management Studio It is working I have transferred the test compact SDF to the Windows Mobile 5 emulator device and with the QuizAnilizer for mobile I can check the existing tables in Test Compact SDF. I do not know how to start replication synchronization on that mobile device. I need to write some C # code or it is possible to make it even easier.

Edit: (Added after the answer to my question ) It may be useful to anyone what the C # code has worked for me: (Using SQL Management Studio - Properties of Existing Membership for My Compact DB) I have read that one Values ​​for replObj property are)

  Private zeros btnSync_Click (Object Sender, EventArgs e) {SqlCeConnection sqlCeConn = Null; SqlCeReplication replObj = new SqlCeReplication (); String connString = @ "data source = \ my document \ TestReplicationCompactDB.sdf; password = bero"; ReplObj.InternetUrl = @ "http://192.168.99.99/VirtualDirectoryForCompactDBReplication/sqlcesa35.dll" ;; ReplObj.PublisherDatabase = "TestReplicationDB"; ReplObj.PublisherSecurityMode = Security Type NTAuthentication ;; ReplObj.Publisher = @ "DBTSSRV \ SQL2008"; ReplObj.Publication = "TestReplication2"; ReplObj.Subscriber = "TestReplication"; ReplObj.SubscriberConnectionString = @ "Data Source = \ My Documents \ TestReplicationCompactDB.sdf; password = bero"; ReplObj.InternetLogin = @ "ares \ intor"; ReplObj.InternetPassword = "intor"; Try {sqlCeConn = new SqlCeConnection (connString); SqlCeConn.Open (); Replobb.Synchronize (); SqlCeConn.Close (); } Hold (Exception pre) {Message Box. Show (ex.Message); If (sqlCeConn = null & amp; sqlCeon.State == ConnectionState.Open) sqlCeConn.Close (); Return; } String countPublisherChanges = replObj.PublisherChanges.ToString (); String countSubScriberChanges = replObj.SubscriberChanges.ToString (); MessageBox.Show (String.Format ("{0} ends with customer change and publisher change", countSubScriberChanges, countPublisherChanges); }  "itemprop =" text "> 

After you type" some "C # code, the need to write SSMS at the end of the wizard In you get some sample code.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -