473,471 Members | 1,898 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problem with Web.config

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?
Nov 18 '05 #1
1 1344
Dave,

try (with mysql-connstr ofcourse),

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="ConnectionString"
value="server=localhost;uid=sa;pwd=;database=north wind" />
</appSettings>
<system.web></system.web>
</configuration>
ConfigurationSettings.AppSettings["ConnectionString"]

hope it helps
/Lasse

"Dave" <da*********@hotmail.com> wrote in message
news:ef**************@TK2MSFTNGP09.phx.gbl...
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?

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Dan Perl | last post by:
Here is a problem I am having trouble with and I hope someone in this group will suggest a solution. First, some code that works. 3 classes that are derived from each other (A->B->C), each one...
1
by: timothy.williams | last post by:
I'm trying to install wxPython 2.5.3.1 using Python 2.3.2 on a Fedora 2 machine. I have python in a non-standard place, but I'm using --prefix with the configure script to point to where I have...
13
by: Wolfgang Kaml | last post by:
Hello All, I have been researching newsgroups and knowledgebase all morning and not found a solution that would solve the problem I have. I am having an ASP or ASPX web page that implement a...
2
by: Eric Caron | last post by:
Hi Here's my problem, I create a windows service with Config.xml file. All setup for my service is in this file. I create a windows application to manage these settings (Config.XML File). This...
0
by: Johannes H?drich | last post by:
Hello folks, i've got a tough problem with configuration the CMAB in my asp.net application. Following scenario is given: root directory (ASP.NET Application) |- web.config (access from CMAB...
2
by: Praveen K | last post by:
I have a problem in communicating between the C# and the Excel Interop objects. The problem is something as described below. I use Microsoft Office-XP PIA dll’s as these dll’s were been...
10
by: Antoon Pardon | last post by:
I have the following little piece of code: class Cfg:pass #config = Cfg() def assign(): setattr(config, 'Start' , ) def foo(): config = Cfg()
2
by: Ian | last post by:
Hi, I am trying to use machine.config to store database settings for a connection wrapper class I am using as part of the data layer of an n-tier system. Have added the following section to...
3
by: Alok yadav | last post by:
I have an open IP and on that IP our main application is hosted. it uses ajax. in web.config file i have register ajax handlers. there are also other sites or project on that IP. now my problem is...
5
by: =?Utf-8?B?VGhlIE1hbiBGcm9tIFNRTA==?= | last post by:
I'm having the darndest XML config file problem that I really need help with. I'm supporting a .NET 1.1 desktop application with its own config file, and I implement IConfigurationSectionHandler...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.