Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Testing if a Command return Nothing
Message
From
29/10/2007 10:12:08
 
 
To
29/10/2007 09:00:08
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
VB 8.0
Miscellaneous
Thread ID:
01264340
Message ID:
01264728
Views:
11
Mike,

You may want to check for dbnull.value as well as execute scalar returns nothing is there is absolutly nothing returned like your where clause excludes everything or it returns dbnull if there are records but the value is null.



>result = cmd.ExecuteScalar()
>if (result is not nothing) andalso (result isnot dbnull.value)'is this correct VB syntax?
> result = result.ToString
>else
> result = ""
>endif
Previous
Reply
Map
View

Click here to load this message in the networking platform