Hi Larry,

You have to create your own custom configuration handler using classes
ConfigurationSection
ConfigurationElementCollection
ConfigurationElement

Check out these links
http://benhollis.net/blog/2006/10/02/creating-nested-custom-configuration-sections-in-aspnet-20/
http://stackoverflow.com/questions/730153/custom-configuration-in-net
http://www.devnewsgroups.net/dotnetframework/t43210-2-0-nested-configuration-data.aspx

Thanks
Raghu



On Tue, Nov 2, 2010 at 6:17 PM, Larry <[email protected]> wrote:

> Hi Raghupathi,
>
> I've seen the 2nd MS link before, but it doesn't address the sort of
> structure that I have with a collection within a collection.  I need
> to have it so that I would have one class where I can roll through
> each "Clinic", and within each clinic, roll through each "LocInfo"
> maintaining the relationship of LocInfo to Clinic.
>
> In the Section Grouping example (1st link), it doesn't show what the
> actual configuration XML, just the section groupings, so I'm having a
> problem invisioning what the config XML would look like.  It appears
> though that this example is only showing how to retrieve the
> ConfigSections information, not the actual configuration information.
> Unless I'm completely missing the point (possible...), I don't
> understand how this would relate to the configuration XML structure
> type that I'm looking to use.
>
> Thanks,
>
> Larry
>
>
>
> On Nov 2, 2:43 am, Raghupathi Kamuni <[email protected]> wrote:
> > Group them into section group.
> >
> > In the Web.config file, add a sectionGroup element and a section element
> > inside the configSections element.
> >
> > The ConfigurationSectionGroup class represents the sectionGroup XML
> element
> > that is used to group sections when they are defined in the
> configSections
> > element of a configuration file.
> >
> > Get an instance of the custom configuration object and use the GetSection
> > method
> >
> > http://msdn.microsoft.com/en-us/library/system.configuration.configur...
> >
> > http://msdn.microsoft.com/en-us/library/2tw134k3.aspx
> >
> >
> >
>  > On Sun, Oct 31, 2010 at 9:30 PM, Larry <[email protected]> wrote:
> > > Really??? Nobody out there has done something similar to my example
> > > using the Custom Configuration Section??  Come on people...I know
> > > there are some VERY smart folks out there... Someone must have done
> > > this at one time.  I really need someone's help with this.
> >
> > > Thanks!
> >
> > > Larry
> >
> > > On Oct 27, 9:00 am, Larry <[email protected]> wrote:
> > > > Hi,
> >
> > > > I've written a windows service in VS 2008 (VB) that used the
> > > > appSettings for some configurations.  Recently I have a need for more
> > > > complex configurations in this program.  I initially thought that I
> > > > would just create an XML file with the structure that I needed and
> > > > write XML parsing to get my config info, but then I read about .NET
> > > > 2's Custom Configuration Section.  Since I'm not a big fan of writing
> > > > XML parsing, I thought that I could do this with the new
> functionality
> > > > of .NET.  However, I'm not able to find examples of creating the
> > > > Custom Configuration Section class for a structure with a collection
> > > > within a collection.  I've really been trying to figure it out myself
> > > > from more simple examples of singular collection-based configs, but
> am
> > > > just not quite getting it.  I wonder if anyone out there can direct
> me
> > > > to some more complex examples, or can tell me what I need to do to
> > > > create this class for my structure.  Below is an example of what I
> > > > would need my config to look like.
> >
> > > > <ClinicDefs>
> > > >    <Clinic ID="AAA" OEMeaning="NNN" CDBID="YYY" CTable="ZZZ">
> > > >        <LocInfo LocID="12345" />
> > > >        <LocInfo LocID="99999999" />
> > > >   </Clinic>
> > > >   <Clinic ID="BBB" OEMeaning="GGGG" CDBID="XXXX" CTable="SSSS">
> > > >        <LocInfo LocID="5555" />
> > > >        <LocInfo LocID="111" ApptTypeCd="777777" />
> > > >   </Clinic>
> > > > </ClinicDefs>
> >
> > > > Any help or direction would be appreciated!   Although I can usually
> > > > mentally convert C# to VB, examples in VB would be helpful.
> >
> > > > Thanks,
> >
> > > > Larry- Hide quoted text -
> >
> > - Show quoted text -

Reply via email to