G
Guest
In app.config, I create a sectionGroup which includes NameValueSectionHandler
and SingleTagSectionHandler. How can I get the child list of that
sectionGroup? Is there any build-in functions like
ConfigurationSettings.GetConfig("")? Or I need to write a function to find
the child node?
For example, the app.config
<sectionGroup name="table1">
<section name="connection"
type="System.Configuration.NameValueSectionHandler" />
<section name="col1" type="System.Configuration.SingleTagSectionHandler" />
<section name="col2" type="System.Configuration.SingleTagSectionHandler" />
<section name="col3" type="System.Configuration.SingleTagSectionHandler" />
</sectionGroup>
<table1>
<connection>
<add key="tablename" value="table1" />
<add key="connectionstring" value="Persist Security Info=False;Integrated
Security=False;Connect Timeout=30;server=localhost;database=a;User
ID=a;Password=a;" />
<add key="selectsql" value="Select * From table1" />
</connection>
<col1 field="char1" type="char" length="5" />
<col2 field="varchar1" type="varchar" length="10" />
<col3 field="nvarchar1" type="nvarchar" length="50" />
</table1>
How can I get the child node sectionGroup "table1"?? I want to retrive the
following list: connection, col1, col2, col3.
Thanks.
and SingleTagSectionHandler. How can I get the child list of that
sectionGroup? Is there any build-in functions like
ConfigurationSettings.GetConfig("")? Or I need to write a function to find
the child node?
For example, the app.config
<sectionGroup name="table1">
<section name="connection"
type="System.Configuration.NameValueSectionHandler" />
<section name="col1" type="System.Configuration.SingleTagSectionHandler" />
<section name="col2" type="System.Configuration.SingleTagSectionHandler" />
<section name="col3" type="System.Configuration.SingleTagSectionHandler" />
</sectionGroup>
<table1>
<connection>
<add key="tablename" value="table1" />
<add key="connectionstring" value="Persist Security Info=False;Integrated
Security=False;Connect Timeout=30;server=localhost;database=a;User
ID=a;Password=a;" />
<add key="selectsql" value="Select * From table1" />
</connection>
<col1 field="char1" type="char" length="5" />
<col2 field="varchar1" type="varchar" length="10" />
<col3 field="nvarchar1" type="nvarchar" length="50" />
</table1>
How can I get the child node sectionGroup "table1"?? I want to retrive the
following list: connection, col1, col2, col3.
Thanks.