0

I have a database created using the code-first approach against SQL Server Express. I'm trying to view the database in Management Studio, but cannot find the database. VS Database Explorer also cannot seem to find it.

I've searched about but cannot find any reference to what I'm after. Is it possible to browse a database running in the dev fabric?

2 Answers 2

0

Usually if we create a new database in Visual Studio, it will give us a database file, but it won’t register the database in SQL Server Management Studio. So please manually attach the database file to SQL Server Management Studio. First please find the database file, normally it is under the AppData folder of our project. Then I would like to suggest you to check http://msdn.microsoft.com/en-us/library/ms190209.aspx for instructions on how to attach the database.

Best Regards,

Ming Xu.

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

Comments

0

Take a look at Scott Gu's blog post on EF Code First and DB Generation: http://weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development-with-entity-framework-4.aspx

The Azure Dev Fabric has nothing to do with the DB layer, the connection string handles all this for you i.e. when you deploy to SQL Azure your DB will go there, the only thing that needs changed is the connection string...from localhost (Dev Machine) to SQL Azure connectionn string

HTH

6 Comments

Thanks. I've tried but for some reason, Azure is not liking a SLQ CE database (it cannot create it) and I cannot find the one it creates with SQL Server...
You should not use CE on Azure as Azure machines are stateless (the only reason you should ever use CE on Azure is if you have a DB that will NEVER change). You need to use SQL Server Express (Full) on your Development Environment and then SQL Azure in Azure at runtime.
****Note CE is stored on the file system, not in SQL Server.
I only attempted CE so I could view the data. I still can't seem to find the local SQL Express database that EF creates.
You need to change your connection string to point to SQL Server and it should create the DB if it doesn't exist, check out this post for more inforamtion: stackoverflow.com/questions/8687167/…
|

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.