Groups | Blog | Home
all groups > dotnet ado.net > july 2007 >

dotnet ado.net : value NOTHING can appear in the Object() array filled by the OleDBDataReader ?



pamela fluente
7/11/2007 2:06:48 AM


I am using an OledbDataReader to read each record into an array of
objects, as usual.


My question is:

is it ever possible that one of the values contained in the array be
Nothing.

I have never seen it happen and I would believe it is impossible.

Can anyone confirm that ? And in case what is the reason ?


-P
Frans Bouma [C# MVP]
7/12/2007 1:22:28 AM
[quoted text, click to view]

It's my understanding that it can't happen, NULL values are always
specified as DBNull.Value.

In general, use the native ADO.NET providers instead of oledb to be
sure.

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
pamela fluente
7/12/2007 11:15:26 AM
On 12 Lug, 10:22, "Frans Bouma [C# MVP]"
[quoted text, click to view]

Thanks Frans,

I wanted to make sure that programmatically I only need to check for
dbNull values.

So far I have never neen a Nothing value. But perhaps did not try
hard enough.

I was wondering if perhaps it is actually impossible for some
technical reason (OleDB implementation).

I do have seen however an "Object" type (which is somehow curious).
So I was wondering whether it could also
spit a Nothing value.

BTW I am considering OleDb (and only that) because I am doing a
cross work among many different platforms.

-P
AddThis Social Bookmark Button