Skip to content

GetFieldValueAsync<int?> throws InvalidCastException on NULL column (sync GetFieldValue works fine) #36

@priyankatiwari08

Description

@priyankatiwari08

When I call await reader.GetFieldValueAsync<int?>(0) on a column that contains NULL, it throws InvalidCastException: Specified cast is not valid. instead of returning null.

The synchronous reader.GetFieldValue<int?>(0) on the same column returns null correctly. So GetFieldValueAsync is not handling Nullable<T> the same way as the sync path.

This blocks all of our async data-access code paths that read nullable integer columns.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions