D
Dave
Hello I hves some problem in my Web.conficg file.
The problem is following:
I have created some custom settings in this way:
==============================================
<!-- Define handlers of the custom settings for MailManager system -->
<configSections>
<section name="mySqlSettings"
type="System.Configuration.SingleTagSectionHandler" />
</configSections>
<!-- Define sections of the custom settings for MailManager system -->
<mySqlSettings ConnectionString="My; Connection; String" />
==============================================
Then I'm trying to read this setting from my application at runtime:
==============================================
IDictionary sampleTable = (IDictionary)
ConfigurationSettings.GetConfig("mySqlSettings");
someLabel.Text=(string)sampleTable["ConnectionString"];
==============================================
But when I do it I have the error:
==============================================
Server Error in '/WebApplication1' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.
Parser Error Message: Exception creating section handler.
Source Error:
Line 7: <configSections>
Line 8: <section name="mySqlSettings"
Line 9: type="System.Configuration.SingleTagSectionHandler"
Line 10: />
Line 11: </configSections>
Source File: c:\inetpub\wwwroot\WebApplication1\web.config Line: 9
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
Version:1.1.4322.573
==============================================
Can anybody tell me what I'm doing wrong and how can I fix this problem?
The problem is following:
I have created some custom settings in this way:
==============================================
<!-- Define handlers of the custom settings for MailManager system -->
<configSections>
<section name="mySqlSettings"
type="System.Configuration.SingleTagSectionHandler" />
</configSections>
<!-- Define sections of the custom settings for MailManager system -->
<mySqlSettings ConnectionString="My; Connection; String" />
==============================================
Then I'm trying to read this setting from my application at runtime:
==============================================
IDictionary sampleTable = (IDictionary)
ConfigurationSettings.GetConfig("mySqlSettings");
someLabel.Text=(string)sampleTable["ConnectionString"];
==============================================
But when I do it I have the error:
==============================================
Server Error in '/WebApplication1' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.
Parser Error Message: Exception creating section handler.
Source Error:
Line 7: <configSections>
Line 8: <section name="mySqlSettings"
Line 9: type="System.Configuration.SingleTagSectionHandler"
Line 10: />
Line 11: </configSections>
Source File: c:\inetpub\wwwroot\WebApplication1\web.config Line: 9
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
Version:1.1.4322.573
==============================================
Can anybody tell me what I'm doing wrong and how can I fix this problem?