我的 ASP NET MVC 3 CodeFirst 项目使用哪个数据库?
我需要找出当我使用 Code First 方法使用 EF 4.3 创建 MVC3 项目时默认使用哪个数据库。 我没有在 Web.config 中输入任何连接信息,应用程序正在运行,但我在本地 SQL 2008 Server 中找不到任何相关数据。
提前致谢!
I need to find out, which database is used by default when I create a MVC3 project with EF 4.3 using the Code First approach.
I have not entered any connection information in the Web.config, the application is working , but I cannot find any related data in my local SQL 2008 Server.
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
默认情况下,SQL Express 服务器位于本地计算机中,您也可以通过 DbContext 构造函数或 web.config 文件更改连接。
以下两个链接将帮助您了解 EF 如何连接数据库
http://blogs.msdn.com/b/adonet/archive/2011/01/27/using-dbcontext-in-ef-feature-ctp5-part-2-connections-and-models。 aspx
http://blogs .msdn.com/b/adonet/archive/2012/01/12/ef-4-3-configuration-file-settings.aspx
SQL Express server in your local machine by default, you can also change the connection via DbContext constructor or web.config file.
Following two links will help you to understand how EF connect database
http://blogs.msdn.com/b/adonet/archive/2011/01/27/using-dbcontext-in-ef-feature-ctp5-part-2-connections-and-models.aspx
http://blogs.msdn.com/b/adonet/archive/2012/01/12/ef-4-3-configuration-file-settings.aspx
默认情况下将使用 SQL Express。
检查您的 AppData 文件夹以找到您的数据库文件。
SQL Express will be used by default.
Check your AppData folder to find your database file.