如果你编写的 SQL Server CE 应用程序出现下面的错误信息: Error Code: 8007000E
Message: Not enough storage is available to complete this operation.
Minor Err.:0 Source: Microsoft SQL Server 2000 Windows CE Edition
或者 Error Code: 8007000E
Message: 没有足够的存储空间来完成该操作。
Minor Err.:0 Source: Microsoft SQL Server 2000 Windows CE Edition 可能是以下原因导致的:
你在使用 SqlCeDataAdapter 对象填充 DataSet 后,没有显式地调用相关 SqlCeCommand 对象的 Dispose 方法。 解决方法: 在使用完 SqlCeDataAdapter 对象后,显式地调用与 SqlCeDataAdapter 对象相关的 SqlCeCommand 对象的 Dispose 方法。包括有 SelectCommand、InsertCommand、UpdateCommand 和 DeleteCommand。 示例代码:
public static DataSet LoadData()
{
string sqlstring = "";
// Make the connection to the SQL Server CE data source
SqlCeConnection conn = new SqlCeConnection("Data Source=");
// Create the SqlCeDataAdapter object
sqlCeDataAdapter da = new SqlCeDataAdapter();
// Create the DataSet object
DataSet ds = new DataSet();
try
{
sqlstring = "select name from mytable where name = ?";
// Create the SelectCommand instance to run a select query
da.SelectCommand = new SqlCeCommand();