Article ID: 824462 - View products that this article applies to.
If you use the SqlCeDataAdapter object to populate a DataSet object, and you do not explicitly call the Dispose method for all the associated SqlCeCommand instances, you may receive the following error message:
Note The type of SqlCeCommand instances may be select, insert, update, or delete.
Error Code: 8007000E
Message: Not enough storage is available to complete this operation.
To resolve this problem, explicitly call the Dispose method for the SqlCeCommand instances when you use SqlCeCommand instances with a SqlCeDataAdapter object.
The following code sample shows how to populate a DataSet object with rows from a Microsoft SQL Server 2000 Windows CE Edition or Microsoft SQL Server 2005 Compact Edition database table by using a SelectCommand instance with the SqlCeDataAdapter object:
Note The SelectCommand instance is disposed by explicitly calling the Dispose method in the Finally block.
The following code sample provides a generic method that can be used to clean up all the command objects that are associated with the SqlCeDataAdapter object, such as SelectCommand, InsertCommand, UpdateCommand, and DeleteCommand objects:
Note The generic method in this sample accepts an object of type IDbDataAdapter as the input parameter, disposes the command objects that are associated with the IDbDataAdapter object, and then returns the resulting IDbDataAdapter object.
For more information about using the SqlCeDataAdapter object to retrieve data from a SQL Server CE database, click the following article number to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/813731/ )How to retrieve data from a SQL Server CE 2.0 database or from a SQL Server 2005 Compact Edition database and save the data in an XML document
Contact us for more help
Connect with Answer Desk for expert help.