Hi,
If you are using a model, edmx file, then you can open the model in VS and right click to get an option to generate a database from the model.
If using code first then if you add Database.CreateIfExists() to the constructor of your context then the database should be created for you if it doesn't exist. So changing your connection string to a new database or deleting the current one should
force EF to create a new one, obviously this will destroy all data in the database so a backup would be good idea. EF will then create the database when it first attempts to use it and so you will have a new empty database.
Alternatively you could use something like Code First Migrations to generate migrations from your model that would be executed against a database. This is more of a way to manage your schema changes going forward though. If you have migrations setup you
can use the -script option to generate a SQL script to execute.
Information on migrations is here:
http://msdn.microsoft.com/en-us/data/jj591621
Edit: SQL Management Studio has the ability to script a database to a file as well if I remember correctly.
We are seeing a lot of great Entity Framework questions (and answers) from the community on Stack Overflow. As a result, our team is going to spend more time reading and answering questions posted on Stack Overflow. We would encourage you to post questions
on Stack Overflow using the entity-framework tag. We will also continue to monitor the Entity Framework forum.