Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If it's a small, fairly simple chunk of data, you can create an XML serializable class and very easily write it to disk on shutdown and read it back on startup. For a simple enough class, you can just add the <a href="http://msdn.microsoft.com/en-us/library/system.serializableattribute.aspx" rel="nofollow noreferrer">[Serializable]</a> attribute, and the <a href="http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx" rel="nofollow noreferrer">XmlSerializer</a> will automatically know how to serialize/deserialize it.</p> <p>If you have enough data that a SQL database would be a better fit, look into <a href="http://www.microsoft.com/Sqlserver/2008/en/us/compact.aspx" rel="nofollow noreferrer">SQL Server Compact Edition</a> or the <a href="http://sqlite.phxsoftware.com/" rel="nofollow noreferrer">System.Data.SQLite</a> binding for <a href="http://www.sqlite.org/about.html" rel="nofollow noreferrer">SQLite</a>.</p> <p>Both will let you create a database as a single file, without having to install any extra Windows services or configure anything. System.Data.SQLite doesn't even need to be installed - it's contained entirely with the .dll that your project references.</p> <p>In either case, the best location for the file is probably <a href="http://msdn.microsoft.com/en-us/library/system.environment.specialfolder%28VS.80%29.aspx" rel="nofollow noreferrer">SpecialFolder.CommonApplicationData</a> - I think this ends up being C:\ProgramData\ on Vista, but avoids having to hardcode the exact path.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload