My below method is throwing an error:
Error 205 An object reference is required for the non-static field, method, or property 'System.Collections.DictionaryEntry.Key.get
static string GetConfigValue(NameValueCollection tempCollection)
{
string paymentDisposition = string.Empty;
Hashtable tempCollectionHash = new Hashtable();
foreach (string key in tempCollection.Keys)
{
tempCollectionHash.Add(key, tempCollection[key]);
}
if(tempCollectionHash.ContainsKey("Cancellation"))
paymentDisposition = (string)tempCollectionHash["Cancellation"];
foreach (DictionaryEntry entry in tempCollectionHash)
{
if (DictionaryEntry.Key.Contains(" Cancellation"))
{
paymentDisposition = DictionaryEntry.Value.;
}
}
return paymentDisposition;
}
any idea why it's throwing error.