I'm working on a WinForms application which also has some WPF elements. Until now I used to store data in xml files but I'd like to try and use a database. What I want to store is objects of a couple of classes I have. How should I create the database and what database should it be? I want it to be transparent to the user.
3 Answers
For a couple of objects, if you don't have too much data, I recommend SQL Server Compact
Top features:
- Free to use and distribute
- Supports desktops and mobile devices
- Small footprint for easy deployment
- Fully embeddable architecture
- No administration required
- Single file, code-free database format
- Support for ClickOnce, XCopy, MSI, CAB, and non-admin embedded installation options
- Supports all Microsoft Windows embedded, mobile, desktop, and server operating systems
- Supports a rich subset of Transact-SQL syntax and SQL Server data types
- Microsoft Visual Studio 2008 integration
- Supports ADO.NET, LINQ to SQL, LINQ to Entities, and the ADO.NET Entity Framework
- Supports multiple concurrent local connections
1 Comment
user579674
Thanks, from what I read too, it seems to be the best option. How do I connect it to my application? Do I do it with the wizards for adding a new data source or with code? Trying with the wizards asks for choosing location and username/password. But I just need it to be created in the default location of the app.