Is there a quick and simple way to check if a key exists in a NameValueCollection without looping through it?
Looking for something like Dictionary.ContainsKey() or
I am using this collection, when I worked in small elements collection.
Where elements lot, I think need use "Dictionary". My code:
NameValueCollection ProdIdes;
string prodId = _cfg.ProdIdes[key];
if (string.IsNullOrEmpty(prodId))
{
......
}
Or may be use this:
string prodId = _cfg.ProdIdes[key] !=null ? "found" : "not found";