I've got an object called configNode of type
System.Configuration.ConfigXmlElement.
To read data from a config file I have code such as this:
string myAttribute =
configNode.Attributes["someAttribute"].Value;
If the attribute is missing or incorrectly named then I get
a
System.NullReferenceException.
Is there a way to check for attribute existence and such?
Using try
catch for this seems more like a last resort then the right
way to write
the code.
Thanks,
Alex Smotritsky
Thanks,
Alex Smotritsky
212-698-0394
alex.smotritsky genzyme.com
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|