Skip to content

System.Data.SqlClient clarify SqlDataReader get char #68

@Wraith2

Description

@Wraith2

Sql Server doesn't have an individual char datatype and in desktop .net the SqlDataReader.GetChar is marked as not browsable and implemented as a NotSupportedException. The version in this repository lacks the browsable attribute (in src and ref) and I think it should be re-added.

The documentation for SqlDataReader.GetFieldValue<T> lists char as one of the permitted types but it will not work, there is no metadata support or way to get a char from the database. This means it will always throw an InvalidCastException and I believe it should throw NotSupportedException where T is char to align with GetChar. This would be a behaviour change and need adding to the documentation.

@saurabh500 @afsanehr @tarikulsabbir

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions