Putting Complex Datatypes into config file using system.configurat

G

Guest

In the system.configuration namespace, is there any way to save a Dataset or
any other custom structure in a section? I know how to make a class and
derive it from the section class; however, any properties I want to save
within that class have to be basic types. Right now if I try to use a complex
type, then I get an error that it could not find the converter.

In the configuration application block I could write datasets and any kind
of object type to the configuration files. I can't figure out a way to do
this with the system.configuration namespace unless I break apart each object
into more basic objects like string/int, etc. Do I have to revert to
converting the object to an xml file first on disk and then loading that xml
into an configxmldocument in system.configuration?

The programmer before me put datasets in the configuration sections, so I
would like to keep it the same so I don't have to worry about breaking other
code that depends on this structure.
 
M

Michael Nemtsev

Hello cyberstrike,

The context of config shouldn't be changed manually, it's bad view
But u have System.XML - u may change it this way

c> In the system.configuration namespace, is there any way to save a
c> Dataset or any other custom structure in a section? I know how to
c> make a class and derive it from the section class; however, any
c> properties I want to save within that class have to be basic types.
c> Right now if I try to use a complex type, then I get an error that it
c> could not find the converter.
c>
c> In the configuration application block I could write datasets and any
c> kind of object type to the configuration files. I can't figure out a
c> way to do this with the system.configuration namespace unless I break
c> apart each object into more basic objects like string/int, etc. Do I
c> have to revert to converting the object to an xml file first on disk
c> and then loading that xml into an configxmldocument in
c> system.configuration?
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top