473,857 Members | 1,870 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Custom section in config file problem

1 New Member

I have a problem in accessing "sqlServerCatal ogNameOverwrite s" section in app.config file.

Expand|Select|Wrap|Line Numbers
  1. <configuration>
  2.   <configSections>
  3.     <section name="sqlServerCatalogNameOverwrites"  type="System.Configuration.NameValueSectionHandler" />
  4.   </configSections>
  6.   <sqlServerCatalogNameOverwrites>
  7.     <add key="ISDev17" value="ISDev18" />
  8.   </sqlServerCatalogNameOverwrites>
  9. </configuration>
Third party software requires such configuration which i need to modify programatically .

I've tried
Expand|Select|Wrap|Line Numbers
  1. ConfigurationManager.GetSection("sqlServerCatalogNameOverwrites")
but this accesses readonly configuration information.

I've also tried

Expand|Select|Wrap|Line Numbers
  1. Configuration config = ConfigurationManager.OpenExeConfiguration (ConfigurationUserLevel.None);
  2. ConfigurationSection section = config.GetSection("sqlServerCatalogNameOverwrites");
Now i'm in stuck accessing key-value pair.
I should implement "ConfigurationS ection", "ConfigurationE lement", "ConfigurationP roperty" and point to my own type in config file.
Problem is i can't change type, section type must be System.Configur ation.NameValue SectionHandler.

Is any way to change the configuration?

Any help is appreciated.
Dec 16 '09 #1
0 1753

Sign in to post your reply or Sign up for a free account.

Similar topics

by: SÝren Lund | last post by:
Hello, I have implemented a custom config section handler by implementing the IConfigurationSectionHandler interface. I have registered this handler in web.config and everything works fine ... for a while. At random points in time my section handler stops working and throws the exception: Configuration Error Description: An error occurred during the processing of a configuration
by: Nick Gilbert | last post by:
Hi, I would like the ability to store the configuration settings for all versions of my site in a single web.config file by using different sections. Eg: <siteConfig> <machine name="XENON"> <site url="/blog/"> <mode value="live">
by: Mads Brydegaard | last post by:
Hi, I have created a custom Config handler for reading a custom config section in my .config file(s) It works very well! I have placed a web.config in my root directory and then I use sub files in sub diretories overriding various settings in the config file. Very nice strategy which really makes it easy to customize generic applications.
by: Paloma García | last post by:
Dear all, I have created personalized configuration sections in my web project following the instructions described in this page http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconDeclaringCustomConfigurationSections.asp The problem is that I using the same code and I get the error "Object reference not set to an instance of an object" in the line where I try to read the first parameter (in the page...
by: Tabi | last post by:
Hi, I want to create a custom section in my web.config that can hold my custom values. I created a section in web.config as written below. <configSections> <section name="myCustomSection" type="ComIT.Applications.Common.ConfigurationSections.MyHandler" allowLocation="true" allowDefinition="Everywhere" /> </configSections>
by: Jeff Hegedus | last post by:
I have a dll that requires some configuration data. I put the configuration data in a custom configuration section in a config file that is loaded in the installation folder of the dll. If I install the dll to the same directory as the exe which uses it, everything works as expected but if I load the dll in any other directory, I get the following error... 2007-02-04 16:36:51,171 DEBUG CentrifugeBHO.CentrifugeBHO - dllPath =...
by: =?Utf-8?B?RG91Z2llIEJyb3du?= | last post by:
Hi I've written custom configuration section (inherits from System.Configuration.ConfigurationSection) to simplify the contents of the config file and to make life easier when accessing them in code. The configuration section is contained within the exe (it's a simple test case!) and everything works well debugging within the IDE or if the application is deployed on a drive or share that has been granted full trust. For the share the...
by: Atul Thombre | last post by:
Hello, I am developing a custom membership provider. For that I built a prototype that uses a SQL Server 2005 database as a backend store. I implemented the class System.Web.Security.MembershipProvider and implemented few necessary methods. The methods use SQL for interacting with the SQL Server database. I put all this code in a class library. I also created a simple Website using Visual Studio 2005 and configured the Web.config to...
by: Smithers | last post by:
I have a Windows Forms application that implements a plug-in architecture whereby required assemblies are identified and loaded dynamically. Here are the relevant classes: A = application = Windows Forms class B = a singleton hosted within A. B is responsible for dynamically loading classes X, Y, and Z.
by: mcstrini | last post by:
I'm trying to have my application use a special config file which is shared across servers, and want to include a custom section (for URLs of report services associated with database instances). However, my section doesn't seem to be recognized (GetSection("ReportServerUrls") returns null). I don't really see how what I'm doing differs from the usage examples I've found. I have my XML config itself: <?xml version="1.0"...
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Duprť who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.