dotnet / dotnet/dotnet-api-docs

Reference to DBNull.Value in OdbcDataReader.Item[]'s value

Open
#5,064 0 comments 0 reactions 0 assignees View on GitHub
area-System.Data.Odbc Pri3 untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

Now, [the docs for OdbcDataReader.Item[]](https://docs.microsoft.com/en-US/dotnet/api/system.data.odbc.odbcdatareader.item?view=netframework-4.5#System_Data_Odbc_OdbcDataReader_Item_System_Int32_)'s value say:

> The value of the specified column in its native format.

I think this is somehow confusing when dealing with null values in the database side. Which type can you expect? Maybe a null reference? In my opinion, adding a reference to DBNull.Value will help to make these cases clearer, specially for unexperienced ADO users.

I know about DBNull.Value by experience, but I don't know if ODBC data sources not being databases can return a different type if a field has no value.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.