Microsoft KB Archive/912432

= You receive a compiler error message when you call the Dispose(BooleanParameter) method of the SqlCeDataReader object in a SQL Server 2005 Compact Edition project =

Article ID: 912432

Article Last Modified on 5/11/2007

-

APPLIES TO


 * Microsoft SQL Server 2005 Compact Edition

-





SYMPTOMS
In a Microsoft SQL Server 2005 Compact Edition (SQL Server Compact Edition) project, you call the Dispose method of the SqlCeDataReader object. When you do this, you receive the following compiler error message:

'System.Data.Common.DbDataReader.Dispose(bool)' is inaccessible due to its protection level

Note  is a placeholder for a parameter of the Boolean type that you pass to the Dispose method.



CAUSE
This problem occurs because the access modifier of the Dispose method of the SqlCeDataReader object is set to Protected. You cannot call the method directly in runtime.



RESOLUTION
To resolve this problem, use the nonparameter version of the Dispose method of the SqlCeDataReader object.



MORE INFORMATION
For more information about the Dispose method, visit the following Microsoft Developer Network (MSDN) Web site:

http://msdn2.microsoft.com/en-us/library/fs2xkftw(vs.71).aspx

Keywords: kbprb KB912432

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.