现在的位置: 首页 > 综合 > 正文

BUG: The GetSchemaTable method of the SqlDataReader object returns the wrong column name

2013年11月20日 ⁄ 综合 ⁄ 共 709字 ⁄ 字号 评论关闭

SYMPTOMS

The GetSchemaTable method of the SqlDataReader object returns columns, the BaseServerName and BaseCatalogName properties. However, SqlDataReader.GetSchemaTable should only return BaseCatalogName.

CAUSE

In addition to the columns that are described in the Microsoft .NET Framework Class Library Software Development Kit (SDK) documentation, SqlDataReader.GetSchemaTable returns a column named BaseServerName. BaseServerName is the name of the Microsoft SQL Server instance that SqlDataReader uses. BaseServerName appears before BaseCatalogName in the DataTable that describes the column metadata.

RESOLUTION

Because this problem does not occur with the OleDbDataReader object, you can use OleDbDataReader to obtain the SchemaTable information.

 

抱歉!评论已关闭.