I really don't have the idea on why I am getting 0
value on this:
But this code works well:
int val = Convert.ToInt32("1546");
Here is the appsetting:
<add key="PesoPayMerchantId" value="1546"/>
Any idea?
Edit1
I want to get the integer value of "1546"
, but it fails to work.
Here is the code for getting appsetting:
public static string GetConfigurationString(string appSettingValue)
{
return ConfigurationManager.AppSettings[appSettingValue];
}
I have tried your suggestions, and this is the result:
The string value is correct ("1546")
, but it can't be parse to integer. What is happening here?
Edit 2
I am very sure that the value of:
<add key="PesoPayMerchantId" value="1546"/>
is really a combination of numbers "1546"
But when I try to re-write the string value using Immediate Window
it can now be parsed. But still I can't figure out the very reason of this Bug
?
Edit 3
Finally, it works now, thanks to Johnny
What I did is, I re-write the whole, <add key="PesoPayMerchantId" value="1546"/>
and it can now be parsed. Thanks for all your help. :D