[RESOLVED] xml and dataset/hashtable
i have about 20 key/value pairs that i want to store in an xml file (the key/value pairs store user preferences for my application). would it be best to use a hashtable or a dataset for this? or is there a better way for storing user preferences (without using the registry).
Re: xml and dataset/hashtable
A dataset, because a dataset has the write to xml method which makes life easier for you.
Re: xml and dataset/hashtable
thanks.
im guessing that a dataset also has a read from xml method.
Re: [RESOLVED] xml and dataset/hashtable
Re: [RESOLVED] xml and dataset/hashtable
Not that it really matters for such a small amount of data, but the XML generated for a DataSet will be much more verbose than that for a serialised collection.
Edit:
I also like to create a custom class for my program settings. Each app's settings class is derived from a base class that has a Save method that takes a file path and saves the current instance, and a Shared Load method that takes a file path and deserialises the file to an instance of the class and returns it.
Re: [RESOLVED] xml and dataset/hashtable
what is a serialised collection?
Re: [RESOLVED] xml and dataset/hashtable
Serialisation is the process of converting an object to a form that can be transmitted in a serial manner. You serialise a .NET object to either a binary or text (XML) format for serial transmission, or storage. When you call WriteXml on a DataSet, you are serialising it. The DataSet class implements ISerializable, so it provides its own serialisation functionality. For classes that don't, you would use an XmlSerializer to serialise and deserialise instances. You can also use binary serialisation, but I've never had the pleasure. Binary serialisation is more efficient, I believe, but XML serialisation has the advantage of producing human-readable results.
Re: [RESOLVED] xml and dataset/hashtable
so i could create a hashtable and serialise it to store the data in an xml file?
Re: [RESOLVED] xml and dataset/hashtable
Re: [RESOLVED] xml and dataset/hashtable
thanks...
great link!
EDIT: stupid forum wont let me give rep points until i spread them around.