J
jassi
Hi,
i have an app.config file as follows :
<?xml version="1.0" encoding="utf-8">
<configuration>
<appSettings>
<add key="button1.Text" value="cc1"/>
</appSettings>
</configuration>
I am reading the above file in C# as follows :
System.Configuration.AppSettingsReader myreader = new
System.Configuration.AppSettingsReader();
int i;
Button btn;
for(i=0;i<=4;i++)
{
btn = new Button();
btn.Text =
myreader.GetValue("button1.Text",typeof(System.String)).ToString();
}
But when i run the application it throws the exception- >
'System.Configuration.ConfigurationException'. In the description it says
that ->. Expected 'NAME'. Line 1, position 37. What is wrong with my .config
xml file ??
thanks in advance.
i have an app.config file as follows :
<?xml version="1.0" encoding="utf-8">
<configuration>
<appSettings>
<add key="button1.Text" value="cc1"/>
</appSettings>
</configuration>
I am reading the above file in C# as follows :
System.Configuration.AppSettingsReader myreader = new
System.Configuration.AppSettingsReader();
int i;
Button btn;
for(i=0;i<=4;i++)
{
btn = new Button();
btn.Text =
myreader.GetValue("button1.Text",typeof(System.String)).ToString();
}
But when i run the application it throws the exception- >
'System.Configuration.ConfigurationException'. In the description it says
that ->. Expected 'NAME'. Line 1, position 37. What is wrong with my .config
xml file ??
thanks in advance.