How to easily generate database creation/deployment code

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
Jaans
Posts: 1
Joined: Wed 31 Oct 2012 05:59

How to easily generate database creation/deployment code

Post by Jaans » Wed 31 Oct 2012 06:04

Hi all

We are using LinqConnect for Silverlight (targetting SqlLite).

We need to be able to create the database on the client (in either isolated storage or local disk when installed out of browser). How could I generate the code to recreate the database from our entity developer model?

Thanks,
Jaans

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: How to easily generate database creation/deployment code

Post by MariiaI » Wed 31 Oct 2012 12:48

There are several ways to create database from the model:
1) To synchronize your model and database use 'Update Database From Model' wizard (by right-clicking on the Model Designer area).
JIC: this variant can not be used in runtime.

2) To generate script for creating new database objects from your model use 'Generate Database Script From Model' wizard (by right-clicking on the Model Designer area).

When using these wizards, select the 'Regenerate Storage' option if you want to clear and rebuilt your storage part and model mapping.
For more information about these two approaches, please refer to the corresponding article in the Entity Developer documentation:
Common Concepts->Design Approaches->Updating Database From Model

3) Use of dynamic database creation via the DataContext.CreateDatabase method.
Please refer to:
http://www.devart.com/linqconnect/docs/DDL.html
http://www.devart.com/linqconnect/docs/ ... abase.html

Please tell us if this helps.

Post Reply