.Net User Group Presentation Files – SQL CE
7 February 2007 in .Net, Code, Microsoft | Comments enabled
This evening I delivered a quick presentation on SQL Server 2005 Compact Edition (SQL CE). Below is my demo project that shows how to connect and execute SQL commands. Note that if you run my code you’ll need to update the location of the database file in the connection string. You will also need the SQL CE Runtime (link at the end of this post)
Advantages of SQL CE:
- Tiny footprint, 1.7MB
- Replication to SQL Server, great for Smart Client and Mobile applications
- Works on Windows XP, 2003, Vista, Windows Mobile, CE, Smartphone
- Single file for the database makes deployment easy
- Zero cost!
Limitations of SQL CE:
- Maximum database size of 4GB
- Not all SQL data types or features (you have to sacrifice something
- Note that most of these limitations won’t be an issue for most of you.
Overall it makes great sense to be hooking SQL into any desktop applications. Given the simplicity of integration and small file size it makes a great case for just dropping a SQL engine into any application that needs to store data (much much sexier than managing xml files or any other hybrid data repository).