I’m having a go at learning to use SQL Server CE databases as a storage medium for my applications. I’ve currently been storing data in text and xml files, but thought I should move onto something more appropriate for my project as the text files are getting abit messy.
I have now learnt how to programmatically create an SQL Server CE 4.0 database file in C#, but is there any way to programmatically add an already built Schema to that newly created database file in C#?
I guess, it depends on what approach you use to work with a database. If Linq to Sql is available (say, you’re not using .Net Compact Framework), you can create database by the following code:
instead of
Linq DataContext creates db schema automatically.