Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Testing if a Command return Nothing
Message
De
29/10/2007 10:12:08
 
 
À
29/10/2007 09:00:08
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
VB 8.0
Divers
Thread ID:
01264340
Message ID:
01264728
Vues:
12
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform