0

I am working on MVC 4 web app using Entitiy framework 5. I have an users membership database and an administration which divides data of the website into factories and for each factory i need a different database. Here is where my problem comes :

I need to create a new database into the master with predefined tables and stored procedures with sql script from the C# code. But for this i cannot use entity framework as i saw. I have found some ways with ado sql command calls, but it requires to mix up EF with raw ado.net .

My question is:

Is there a way to execute sql script for creating a whole database from the C# code using EF5 somehow ?

For now the only way that i have found is this : Code to create & connect to a SQL Server database: Whats wrong with it?

Any suggestions would be heplful. Thanks

1

2 Answers 2

1

Look at EntityFramework with code first deployments.

See this http://msdn.microsoft.com/en-us/data/jj193542.aspx

Sign up to request clarification or add additional context in comments.

Comments

1

Create the database and then use this tutorial : http://msdn.microsoft.com/en-us/data/jj200620.aspx. This should help

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.