Actually you are accessing value from your has-table, so you need to first of check how you has-table has been created, as has-table is accepting all the things like 'Key' and 'Value' as object data type, that means you can add combination of value like key is type of integer and value is string, for key is type of string and value is integer, you can create your own combination with any primitive data type as well as user define data type too.
so while converting your code from vb to c#, you need to make some changes manually as here in your code needs.
so please check your
ht_AddressDetails
has table, if it will having key of string data type then use your 'key' variable declared as string instead of object type.
and make appropriate changes to your code like this...
string key = string.Empty;
bool rv = true;
foreach (string key_loopVariable in ht_AddressDetails.Keys) {
key = key_loopVariable;
switch ( key) {
case "city_text":
if (sCity != Convert.ToString(ht_AddressDetails[key])) {
rv = false;
}
break;
}
if(!rv)
break;
}
I have just given example, you need to modify your code by your own way as per you requirement.