RE: FN-FORUM: Null testing problem
date posted 3rd January 2006 23:30
Good point, but unfortunately I don't have control of the SQL Server:(
Thanks,
Craig
-----Original Message-----
Alternatively in your SQL use isnull(Region, '') to return '' if Region
is null at that point.
-----Original Message-----
Craig wrote:
> Hi,
>
> I'm using the following code after doing a good bit of googling to
> find out how to test for NULL in datareader items in ASP.NET VB.
> However, when an item actually contains Null, it blows up. Any
> ideas?
>
> If DBRead.Item("Region") = "" OR DBRead.Item("Region")Is DBNull.Value
> Then .region = ""
> Else
> .region = DBRead.Item("Region")
> End If
>
> Regards,
>
> Craig