If the database becomes larger than 128MB, I get the following error message:
"The database file ist larger than the configured maximum database size. This settings takes effect von the first concurrent database connection only. [Required Max Database Size (in MB; o if unknown) =129]".
I use SQL 2005.
I find a http://msdn.microsoft.com/en-us/library/system.data.sqlserverce.sqlceconnection.connectionstring(vs.80).aspx way so I write the program like this
System.Data.SqlServerCe.SqlCeReplication cerepl = new
System.Data.SqlServerCe.SqlCeReplication();
try
{
cerepl.SubscriberConnectionString = "Data
Source=\\Storage Card\\map4.sdf;"+
"Max Database Size = 256; Max Buffer Size =
1024";
if (File.Exists("map4.sdf") == false)
{
cerepl.InternetUrl = "<connect server>";
cerepl.InternetLogin = "<account>";
cerepl.InternetPassword = "<password>";
cerepl.Publisher = "SELINA";
cerepl.PublisherDatabase = "test2";
//cerepl.PublisherDatabase = "mobile_test";
cerepl.PublisherLogin = "<account>";
cerepl.PublisherPassword = "<password>";
cerepl.Publication = "<publisher>";
cerepl.Subscriber = "<xxx>";
cerepl.AddSubscription
(AddOption.CreateDatabase);
cerepl.Synchronize();
cerepl.SaveProperties();
MessageBox.Show("success!!");
}
else
{
cerepl.LoadProperties();
cerepl.Synchronize();
MessageBox.Show("success!!");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
I use these way even though I can synchronize the databas which is ovet 128M but the file is error. and I find another way hotfix http://support.microsoft.com/kb/935769/en-us/
I install hotfix but the error is also exist. Can anyone tell me how can I do, thank you