Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Knowing string value, can we know the actual data type?
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
XML
Title:
Knowing string value, can we know the actual data type?
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01567536
Message ID:
01567536
Views:
48
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
Next
Reply
Map
View

Click here to load this message in the networking platform