2011-01-05 60 views
2

我試圖在Windows Mobile 6.1中搜索移動SDF數據庫,數據庫大約爲270MB。每當程序試圖從數據庫中讀取我得到這個錯誤:大於配置大小的SQL壓縮數據庫

"The database file is larger than the configured size.
This settings takes effect on the first concurrent database connection only [Required Max Database Size (in MB; 0 if unknown) =0]"

我試圖指定連接字符串中的大小,但我得到一個錯誤還有:

public bool ConnectDB(string strDB, string strPassword) 
{ 
    try 
    { 
     string siz= "300"; 
     string connStr = "Data Source = " + strDB + "; Size = " + siz + "; Password = " + strPassword + ";"; 
     ceConnection = new SqlCeConnection(connStr); 
     ceConnection.Open(); 
     if (ceConnection.State == System.Data.ConnectionState.Open) 
      return true; 
    } catch() {} 
} 

我得到unknown connection option in connection string: Size

請幫忙。

+0

270MB的移動數據庫是相當瘋狂!嘗試使用'MaxDatabaseSize = 2048'。 – leppie 2011-01-05 07:28:14

回答

2

您必須使用 「最大數據庫大小」(以MB爲單位)

"Data Source = " + strDB + "; Max Database Size = " + siz