简体   繁体   English

无法先找到我的EF代码数据库

[英]Can't find my EF code first db

I know that there are some similar topic, but still I haven't found soultion. 我知道也有类似的话题,但是我仍然没有发现灵魂。

I have create a simple ASP.NET MVC app with EF code first. 我首先用EF代码创建了一个简单的ASP.NET MVC应用程序。 I set no connectionstring, and everything works fine. 我没有设置连接字符串,并且一切正常。 I can perform CRUD actions and records are updated. 我可以执行CRUD操作并更新记录。 But I don't know where my database is. 但是我不知道我的数据库在哪里。 I am using Microsoft SQL Server Management Studio to connect to server. 我正在使用Microsoft SQL Server Management Studio连接到服务器。 In Server name field I have tried to put: localhost, ., .\\SQLEXPRESS, my Desktop name. 在服务器名称字段中,我尝试输入:本地主机名,。,。\\ SQLEXPRESS。 These are all answears which I have found searching solutions. 这些都是我在搜索解决方案中找到的答案。 Then in all cases I expand Databases/System Databases and all other Databases, but I can't find mine. 然后在所有情况下我都展开数据库/系统数据库和所有其他数据库,但是找不到我的数据库。

I know, that I can create an empty Database in Management Studio and set connectionstring to this DB (and it works), but I must send app to my teacher, and you know, he want to only click run, without setting up anything. 我知道,我可以在Management Studio中创建一个空数据库,并为此数据库设置连接字符串(并且它可以工作),但是我必须将应用发送给我的老师,而且您知道,他只想单击运行,而无需进行任何设置。

Have you got any solution? 你有什么解决办法吗?

Looked in yourproject/App_Data? 寻找在yourproject / App_Data中? Usually, the DB files are created there 通常,在此处创建数据库文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM