|
 |
aspx thread: IsNull function, please help!!
Message #1 by "Tom Brzeski" <tom.brzeski@o...> on Wed, 17 Jan 2001 17:21:35 -0000
|
|
I need some help with checking for null string value in VB.Net. Since I
can not use VBScript IsNull function anymore, I would like to know which
function I can use to check for nulls.
thanks
Message #2 by "Michael Morisoli" <Michael@M...> on Wed, 17 Jan 2001 09:27:14 -0800
|
|
How about this from the BOL
IsDbNull Function
See Also
Example
IsArray Function | IsDate Function | IsNumeric Function | TypeName
Function | Object Data Type
[This topic is part of a beta release and is subject to change in future
releases. Blank topics are included as placeholders.]
Returns a Boolean value that indicates whether an expression contains no
valid data (Null).
IsDbNull(expression)
The required expression argument is an Object containing a numeric
expression or string expression.
Remarks
IsDbNull returns True if expression is DbNull; otherwise, IsDbNull
returns False. If expression consists of more than one variable, DbNull
in any constituent variable causes True to be returned for the entire
expression.
The DbNull value indicates that the Object contains no valid data.
DbNull is not the same as Nothing, which indicates that a variable has
not yet been initialized. It is also not the same as a zero-length
string (""), which is sometimes referred to as a null string.
Important Use the IsDbNull function to determine whether an expression
contains a DbNull value. Expressions that you might expect to evaluate
to True under some circumstances, such as If Var =3D DbNull and If Var
<>
DbNull, are always False. This is because any expression containing a
DbNull is itself DbNull and, therefore, False.
-----Original Message-----
From: Tom Brzeski [mailto:tom.brzeski@o...]
Sent: Wednesday, January 17, 2001 9:22 AM
To: ASP+
Subject: [aspx] IsNull function, please help!!
I need some help with checking for null string value in VB.Net. Since I
can not use VBScript IsNull function anymore, I would like to know which
function I can use to check for nulls.
thanks
Message #3 by Krishnakant Baderia <krishnabaderia@s...> on Fri, 19 Jan 2001 11:42:47 +0530
|
|
Yeah you are right that IsNull function is no more....and also NULL is also
no more....so there is no question of checking NULLS....now if you want to
check nulity in a object variable than.....you have to use IsDBNull
function......
Krishna Kant Baderia
Sr. Developer
Solutions Infosystems Pvt. Ltd.
www.Solutionsny.com
Phone : (O) +xx-xx-xxxxxxx
(R) +xx-xx-xxxxxxx / xxxxxxx
-----Original Message-----
From: Tom Brzeski [mailto:tom.brzeski@o...]
Sent: Wednesday, January 17, 2001 10:52 PM
To: ASP+
Subject: [aspx] IsNull function, please help!!
I need some help with checking for null string value in VB.Net. Since I
can not use VBScript IsNull function anymore, I would like to know which
function I can use to check for nulls.
thanks
Message #4 by "Jonathan Goodyear" <jon@a...> on Fri, 19 Jan 2001 11:11:32 -0500
|
|
You can use:
Convert.IsDBNull(value)
where value is the item you are checking for null
or
if you are using a DataRow, SQLDataReader, or ADODataReader object, you can
use:
obj.IsNull(ord)
where ord is the column ordinal
Also note that in VB, null is referenced by the keyword Nothing
----jonathan goodyear, mcsd, mcp, cls
president@a...
----- Original Message -----
From: "Krishnakant Baderia" <krishnabaderia@s...>
To: "ASP+" <aspx@p...>
Sent: Friday, January 19, 2001 1:12 AM
Subject: [aspx] RE: IsNull function, please help!!
> Yeah you are right that IsNull function is no more....and also NULL is
also
> no more....so there is no question of checking NULLS....now if you want to
> check nulity in a object variable than.....you have to use IsDBNull
> function......
>
> Krishna Kant Baderia
> Sr. Developer
> Solutions Infosystems Pvt. Ltd.
> www.Solutionsny.com
>
> Phone : (O) +xx-xx-xxxxxxx
> (R) +xx-xx-xxxxxxx / xxxxxxx
>
>
> -----Original Message-----
> From: Tom Brzeski [mailto:tom.brzeski@o...]
> Sent: Wednesday, January 17, 2001 10:52 PM
> To: ASP+
> Subject: [aspx] IsNull function, please help!!
>
>
> I need some help with checking for null string value in VB.Net. Since I
> can not use VBScript IsNull function anymore, I would like to know which
> function I can use to check for nulls.
> thanks
>
>
|
|
 |