我的 ASP NET MVC 3 CodeFirst 项目使用哪个数据库?

发布于 2025-01-08 12:49:25 字数 145 浏览 2 评论 0原文

我需要找出当我使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

岁月苍老的讽刺 2025-01-15 12:49:25

默认情况下,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

你不是我要的菜∠ 2025-01-15 12:49:25

默认情况下将使用 SQL Express。
检查您的 AppData 文件夹以找到您的数据库文件。

SQL Express will be used by default.
Check your AppData folder to find your database file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文