I'm trying to build a .net class to make an emergency backup of some important data in sql server compact edition. It's not a massive amount of data but it does have a fairly complex data structure (30-odd tables with significant cross-referencing). We use Entity Framework to do most of our data work.
Documentation on working with sqlce and .net seems to be a bit thin on the ground and currently I'm struggling a bit. I've created the database file (.sdf) easily enough but ideally I'd like to be able to specify where that file lives rather than have it created in the default (C:\Program Files (x86)\Common Files\microsoft shared\DevServer\10.0 in my case). Is this possible, and if so how?
More importantly I'm concerned that I'm going to have to manually re-create all 30+ tables which is not only absurdly labour intensive but not very scalable either. Is there a way - preferably using entity framework - to grab the subset of data that I need from our central database and insert it into a clean SqlCE database, having it create the necessary tables automatically?
Cheers, Matt