Article ID: 912432 - View products that this article applies to.
In a Microsoft SQL Server 2005 Compact Edition (SQL Server Compact Edition) project or in a Microsoft SQL Server 2005 Mobile Edition (SQL Server Mobile Edition) project, you call the Dispose(BooleanParameter) method of the SqlCeDataReader object. When you do this, you receive the following compiler error message:
Note BooleanParameter is a placeholder for a parameter of the Boolean type that you pass to the Dispose method.
'System.Data.Common.DbDataReader.Dispose(bool)' is inaccessible due to its protection level
This problem occurs because the access modifier of the Dispose(BooleanParameter) method of the SqlCeDataReader object is set to Protected. You cannot call the method directly in runtime.
To resolve this problem, use the nonparameter version of the Dispose method of the SqlCeDataReader object.
For more information about the Dispose method, visit the following Microsoft Developer Network (MSDN) Web site:
Contact us for more help
Connect with Answer Desk for expert help.