Let me use Visual Studio 2008 IDE for editing my local database schema for any SQL Server Compact 3.5 database. However, my way through the documentation as well as in the UI appears to create a belief the application/set up only wants to utilize a single database rather than desires to create brand new ones in line with the existing schema.

Let me have the ability to edit the DB schema using visual tools after which to possess a mechanism for creating new database files in line with the edited schema. By doing this each document that my application produces could be saved in their own individual separate database files (.sdf). In addition, with regards to unit testing, Let me have the ability to create empty temporary .sdf files to be able to run my unit tests with an empty database.

The only method I understand how to produce new empty databases utilizing an existing schema is simply copying my master .sdf file to a different file.

What will be the suggested method to create new .sdf files using C# code? I.e., how you can implement MyModel.Create("foo.sdf") to ensure that it produces .sdf files while using schema I have produced in Visual Studio.

EDIT: Following a lengthy analysis, I wound up ditching VS2008 local database .sdf editor completely and began creating new .sdf files by utilizing LINQ-to-SQL. Now i just specify a lot of C# classes, annotate results with LINQ-to-SQL and make new database files by calling my DataContext's CreateDatabase method. MSDN includes a good document onto it: How to: Dynamically Create a Database (LINQ to SQL)

Produce a "model.sdf" database, that consists of the schema, and perhaps needed initial data. If you wish to produce a new database, you produce a copy out of this model.

You might create the Sql-DDL from an existing database (alternative link), then create a clear database and execute this SQL onto it. This is a great deal reduced.