Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detecting null value on Integer
Message
De
24/01/2016 17:32:45
 
 
À
24/01/2016 17:23:05
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01630133
Message ID:
01630177
Vues:
57
>>>number is not an integer; it's a nullable integer because of the ?
>>> int? value = null;
>>> Console.WriteLine(value.HasValue);
>>> value = 1;
>>> Console.WriteLine(value.HasValue);
>>> Console.WriteLine(value)
>>>
>>>When I run this I get
>>>false
>>>true
>>>1
>>
>>It appears this syntax is C# only. Could it be?
>
>the ? appears to c# only.
>
>This this alternate form
>
>https://msdn.microsoft.com/en-us/library/b3h38hb0%28v=vs.110%29.aspx

According to the Remarks section of your link, you can use Integer? in VB.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform