How can that be? Isn't it supposed to return dbnull if there is nothing in
the select?


Ronen

Re: sqlCommand.ExecuteScalar return value 'undefined value' by Miha

Miha
Thu Dec 04 13:39:05 CST 2003

Hi RA,

You are getting Nothing (VB) or null(C#) value.
I guess if there is nothing (not even a dbnull field) to return you get null
(DBNull is a returned Null from database)

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com

"RA" <ron_a1@hotmail.com> wrote in message
news:O42uU1puDHA.3532@TK2MSFTNGP11.phx.gbl...
> How can that be? Isn't it supposed to return dbnull if there is nothing in
> the select?
>
>
> Ronen
>
>



Re: sqlCommand.ExecuteScalar return value 'undefined value' by bruce

bruce
Thu Dec 04 19:33:43 CST 2003

ExecuteScalar returns the value of the first column of the first row of the
first resultset. if there is no resultset, then there is no value to return,
so it returns null. makes perfect sense.

-- bruce (sqlwork.com)


"RA" <ron_a1@hotmail.com> wrote in message
news:O42uU1puDHA.3532@TK2MSFTNGP11.phx.gbl...
> How can that be? Isn't it supposed to return dbnull if there is nothing in
> the select?
>
>
> Ronen
>
>