on 2013 Apr 07 11:15 AM
I'm trying to use Mobilink 12 to sync between SQL Server 2005 Database (as consolidated database) and a remote ultralite database on a windows mobile device, so i've done the following :
Now I copy the created ultralite db to my windows mobile device ,run the mobilink server and start writing the client test application as the following:
I create a new windows mobile project and I write the following in the form load
String ConnString = "dbf=\\Program Files\\smartdeviceproject1\\test.udb";
Conn = new ULConnection(ConnString);
Conn.Open();
Conn.DatabaseID = 1;
I added a button for the sync process to the form and added the following code to the button click event:
Conn.SyncParms.Publications = "test";
Conn.SyncParms.StreamParms = "";
Conn.SyncParms.UserName = "test";
Conn.SyncParms.Password = "test";
Conn.SyncParms.Version = "test";
Conn.SyncParms.Stream = ULStreamType.TCPIP;
Conn.Synchronize();
And it's running perfectly , my question is Is there anyway to create the database programmatically instead of copying it manually to the device?
Request clarification before answering.
You will need to start the ML server with the -ftr switch which points to the location where the transfer files can be found. You can also have different files for different users by setting up unique folders.
A simple implementation in UL.Net is
ULFileTransfer transfer = new ULFileTransfer(); transfer.UserName = "u"; transfer.Version = "v"; transfer.Stream = ULStreamType.TCPIP; transfer.FileName = "MLFileTransfer.udb"; transfer.LocalFileName = "MLFileTransferReceived.udb"; string[] parms = new string[1]; parms[0] = "You need to supply something"; transfer.AuthenticationParms = parms; transfer.DownloadFile(); transfer = null; System.Console.WriteLine("File transfer complete. ");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Look at ULDatabaseManager CreateDatabase() method to create the database. You can couple this with ULFileTransfer to transfer the schema to the remote and use "ALTER DATABASE SCHEMA FROM FILE" to create the schema in the remote. Another option is push the database to the remote using ULFileTransfer to automate the process.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
30 | |
9 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.