Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Knowing string value, can we know the actual data type?
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
XML
Titre:
Knowing string value, can we know the actual data type?
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01567536
Message ID:
01567536
Vues:
49
Hi everybody,

I have this code:
 if (!xe.IsEmpty)
                    {
                       elementValue = xe.Value;

                       if (!String.IsNullOrWhiteSpace(elementValue) && "false"!=elementValue.ToLower())
where elementValue is a string containing the representation of data. So, the string with the data can be:


/ / - I am not 100% sure if we can have such strings, but it will mean empty date

0.00 - this means empty numeric value

false -- this means empty boolean

0x - this means empty binary

etc.

---------
I am wondering if there is a way to figure out a type based on the string represenation and also check if it's empty or not (for that type)?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform