How do one test for nulls in VB?

R

Randy Galliano

Hello,

I am reading some records into a recordset when I got to assign a text
box the value of one of the fields I get an exception because the
recordset has a null value in it. How do you test for nulls in vb script?

Example:

txtModel.Text = SqlDataReader("Manufacturer") '
Manufacturer is null.

Regards,

Randy.
 
R

Randy Galliano

Randy said:
Hello,

I am reading some records into a recordset when I got to assign a text
box the value of one of the fields I get an exception because the
recordset has a null value in it. How do you test for nulls in vb script?

Example:

txtModel.Text = SqlDataReader("Manufacturer") ' Manufacturer
is null.

Regards,

Randy.


Let me clarify one more thing. I am using .net 2.0 with vb script.
According to the manual on MSDN isNull is a function I can use, but
Visual Studio is saying the function is not defined.

Regards,

Randy.
 
M

Mark Rae [MVP]

Randy Galliano said:
Hello,

I am reading some records into a recordset when I got to assign a text box
the value of one of the fields I get an exception because the recordset
has a null value in it. How do you test for nulls in vb script?

Example:

txtModel.Text = SqlDataReader("Manufacturer") ' Manufacturer
is null.

Regards,

Randy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top