NULL in a database means that the value is not "defined" (i.e. if the price
column for the product is NULL the price is not known, 0 would mean it is
free). This is called DBNull in .NET.
"Nothing" (null in C#) means that the object doesn't exist... (basically
objects are pointers, it means that this pointer is not yet defined).
Patrice
--
"wrytat" <wr****@discussions.microsoft.com> a écrit dans le message de
news:1E**********************************@microsof t.com...
Ok Thanks. Actually what is the difference between null value and nothing?
Very complicated...
"MW de Jager" wrote:
If (yourobject Is Nothing) Then
"wrytat" <wr****@discussions.microsoft.com> wrote in message
news:AD**********************************@microsof t.com... Oh~ Then how do I check that if it is null in VB?
"Patrice" wrote:
> IsDBNull is to check for NULL for values coming from a DB. Here it
looks> like that "theStock" is Nothing (null in C#).
>
> Patrice
>
> --
>
> "wrytat" <wr****@discussions.microsoft.com> a écrit dans le message
de> news:DF**********************************@microsof t.com...
> > How do I check if an object is null in vb? I tried using IsDBNull
but> > it
> > doesn't work at all. It gives me this error when I try statement
like> > If
> Not
> > IsDBNull(theStock.WIPQty) Then:
> >
> > Object reference not set to an instance of an object.
> > Description: An unhandled exception occurred during the execution
of> > the
> > current web request. Please review the stack trace for more
information> about
> > the error and where it originated in the code.
> >
> > Exception Details: System.NullReferenceException: Object reference
not> > set
> > to an instance of an object.
> >
>
>
>