I'd like to store something such as the following the my app.config
file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="DEBUG" value="true"/>
<add key="DEBUGCleanFile" value="true"/>
</appSettings>
<DataGridColumnCollection>
<AGrid value="true">
</AGrid>
<BGrid value="false">
<column1 value="true"/>
<column2 value="true"/>
<column3 value="true"/>
</Bgrid>
</DataGridColumnCollection>
<system.diagnostics>
</system.diagnostics>
</configuration>
I particularly want the DataGridColumnCollection section. I can read
the data fine out of the file using an XMLDocument object. However,
weird things happens. For example, on this line:
using(SqlConnection connection = new SqlConnection(connectionString))
I get this exception:
The type initializer for 'System.Data.SqlClient.SqlConnection' threw an
exception.
The app.config and above line are completely unrelated. When I remove
the DataGridColumnCollection, everything is fine but of course I loose
all of that data. For now, I'm using my own XML file but that is just
more files to haul around. Any suggestions on how I can stick the
DataGridColumnCollection section into app.config?
Thanks,
Brett