none
想請問PDA同步資料庫的問題 RRS feed

  • 問題

  •  

    各位大大好,想請問一下各位
    我現在是用VS2005的資料庫和PDA做同步
    我的資料庫檔案大於128M,在做同步時會出現以下訊息
                                                                                   
    『資料庫檔案大於以設定的資料庫大小上限。
    此設定只對第一個病型資料庫連接產生作用。
    [Required Max Database size (in MB;0 if unknown)=129]』
    就是我將資料庫同步同步到127M的時候,再繼續同步就會出錯,
    同步的檔案瞬間會跳回20K,請問一下有誰有誰也遇過同樣的問題阿?
    這到底該如何解決?
    2008年9月23日 上午 04:44

所有回覆

  • 想請問一下若我的聯結資料庫地方原先是這樣寫

     System.Data.SqlServerCe.SqlCeReplication cerepl = new System.Data.SqlServerCe.SqlCeReplication();
                try
                {

                    cerepl.SubscriberConnectionString = "Data Source=\\Storage Card\\map4.sdf;";

                    if (File.Exists("map4.sdf") == false)
                    {

                        cerepl.InternetUrl = "<連接的server>";
                        cerepl.InternetLogin = "<帳號>";
                        cerepl.InternetPassword = "<password>";

                        cerepl.Publisher = "SELINA";
                        cerepl.PublisherDatabase = "test2";
                        //cerepl.PublisherDatabase = "mobile_test";
                        cerepl.PublisherLogin = "<帳號>";
                        cerepl.PublisherPassword = "<password>";

                        cerepl.Publication = "<發行者名稱>";

                        cerepl.Subscriber = "<xxx>";
                        cerepl.AddSubscription(AddOption.CreateDatabase);
                        cerepl.Synchronize();
                        cerepl.SaveProperties();
                        MessageBox.Show("同步成功!!");

                    }
                    else
                    {
                        cerepl.LoadProperties();
                        cerepl.Synchronize();
                        MessageBox.Show("同步成功!!");
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

    請問一下我是應該如何把下面的加到我原先的才會成功改變資料庫的大小設定阿,想問一下下面這一段程式碼是已經在PDA上建好一個小於128M的時候才可以加入這段,還是可以從零開始同步阿?       

                SqlCeConnection conn = new SqlCeConnection();

                // Set some connection string properties e.g.:
                //
                conn.ConnectionString =
                    "Persist Security Info = False; Data Source = 'SalesData.sdf';" +
                    "Password = '<password>'; File Mode = 'shared read'; " +
                    "Max Database Size = 256; Max Buffer Size = 1024";

                conn.Open();

                // You can change the database while preserving
                // the orignal connection options
                //
                conn.ChangeDatabase("SupportData.sdf");

    2008年9月23日 下午 03:42
  • 謝謝你,我成功了,我將SubscriberConnectionString多加了"Max Database Size = 256; Max Buffer Size = 1024";就成功了,真是太謝謝了。

    想請問一下若我的聯結資料庫地方原先是這樣寫

     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 = "<連接的server>";
                        cerepl.InternetLogin = "<帳號>";
                        cerepl.InternetPassword = "<password>";

                        cerepl.Publisher = "SELINA";
                        cerepl.PublisherDatabase = "test2";
                        //cerepl.PublisherDatabase = "mobile_test";
                        cerepl.PublisherLogin = "<帳號>";
                        cerepl.PublisherPassword = "<password>";

                        cerepl.Publication = "<發行者名稱>";

                        cerepl.Subscriber = "<xxx>";
                        cerepl.AddSubscription(AddOption.CreateDatabase);
                        cerepl.Synchronize();
                        cerepl.SaveProperties();
                        MessageBox.Show("同步成功!!");

                    }
                    else
                    {
                        cerepl.LoadProperties();
                        cerepl.Synchronize();
                        MessageBox.Show("同步成功!!");
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

    2008年9月23日 下午 06:01