SQL Compact 数据库大于配置的大小 [英] SQL Compact Database larger than configured size

查看:33
本文介绍了SQL Compact 数据库大于配置的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Windows Mobile 6.1 中搜索移动 SDF 数据库,该数据库大约为 270MB.每当程序尝试从数据库中读取时,我都会收到此错误:

I'm trying to search a mobile SDF database in Windows Mobile 6.1 and the database is about 270MB. Whenever the program tries to read from the database I get this error:

"数据库文件大于配置的大小.
此设置仅对第一个并发数据库连接生效[所需的最大数据库大小(以 MB 为单位;如果未知则为 0)=0]"

"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]"

我尝试在连接字符串中指定大小,但也出现错误:

I tried specifying the size in the connection string but I get an error as well:

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 () {}
}

我在连接字符串中得到未知的连接选项:大小.

I get unknown connection option in connection string: Size.

请帮忙.

推荐答案

您必须使用最大数据库大小"(以 MB 为单位)

You must use "Max database size" (in MB)

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

这篇关于SQL Compact 数据库大于配置的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆