Microsoft KB Archive/912435

= BUG: Error message when you try to obtain schema information from a SQL Server 2005 Compact Edition database by using the SqlCeConnection.GetSchema method: &quot;NotSupportedException&quot; =

Article ID: 912435

Article Last Modified on 12/7/2006

-

APPLIES TO


 * Microsoft SQL Server 2005 Compact Edition

-



BUG #: 10895 (SQL Server CE)



SYMPTOMS
Consider the following scenario:
 * You create a smart device project in Microsoft Visual Studio 2005.
 * You try to obtain schema information from a Microsoft SQL Server 2005 Compact Edition (SQL Server Compact Edition) database by using the SqlCeConnection.GetSchema method. For example, you try to obtain specific schema information about a column or about a table.

In this scenario, you receive the following error message:

NotSupportedException

This problem occurs when you use one of the following versions of the SqlCeConnection.GetSchema method:
 * SqlCeConnection.GetSchema
 * SqlCeConnection.GetSchema

Note In these versions of the SqlCeConnection.GetSchema method,  is a placeholder for the schema name. is a placeholder for a set of restriction values for the requested schema.



CAUSE
This problem occurs because these versions of the SqlCeConnection.GetSchema method are not supported in SQL Server Compact Edition.



WORKAROUND
To work around this problem, you can obtain schema information about a data source by querying from the INFORMATION_SCHEMA views. For more information about the INFORMATION_SCHEMA views, see the &quot;More Information&quot; section.

Note You can also use the public properties of the SqlCeConnection object to obtain limited schema information about a data source. For example, you can use the Database property and the ServerVersion property.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section.



MORE INFORMATION
The following table lists the INFORMATION_SCHEMA views that are supported by SQL Server Compact Edition.

You can obtain schema information from these views by using the fully qualified name of the INFORMATION_SCHEMA views. For example, you can use the following Transact-SQL statement to obtain schema information about a specific table from the INFORMATION_SCHEMA.TABLES view. SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME=' is a placeholder for the table name that you specify.

