After declaring and compiling your domain (i.e.
your domain object classes), you use dbschema.exe
to derive an sql-script from it. This sql-script in
turn sets up your database for persisting instances
of the domain object classes.

The canonical way to develop a re-motion application
is to have

This is called the canonical project structure. If you have
not read the page canonical project structure yet, please
do so. The following explanation will assume the
canonical project structure.

If you have a sample project that will use the domain
object classes, you can use the application's App.config
(App.config) for telling dbschema.exe what the
name of the database is. If you don't specify an App.config
file, dbschema.exe will generate a USE DatabaseName
for first experiments this is easy to fix manually, of course.

The output file, the sql script for setting up the database,
is named (SetupDB.sql). It does not matter where you store it,
but we invoke dbschema.exe in the solution root, i.e.
the parent directory of all sub-projects. For the PhoneBook
project, this invocation looks like this:

Remotion\net-3.5\bin\debug\dbschema.exe /basedirectory:PhoneBook.domain\bin\debug /verbose /config:PhoneBook.Sample\App.config

If everything works out, dbschema.exe has no output.
Both /verbose and /config are optional. As explained above, dbschema.exe
will generate USE DatabaseName instead of USE PhoneBook (for example),
so that you have to fix the database name manually.

See also