简体   繁体   English

为什么无法将MDF文件添加到Visual Studio

[英]Why can not add mdf file to visual studio

I try to add a mdf file to app_data in mvc. 我尝试将MDF文件添加到mvc中的app_data。 Everytime I get Microsoft visual studio alert with this: 每当我收到Microsoft Visual Studio警报时,都会发出以下提示:

"The file can not be opened because it is being used by another process, please close all applications that might access this file and try again." “由于其他进程正在使用该文件,因此无法打开该文件,请关闭所有可能访问此文件的应用程序,然后重试。”

I disconnected sql and closed it. 我断开了sql的连接并关闭了它。 I then closed all applications and only visual studio was on. 然后,我关闭了所有应用程序,仅打开了Visual Studio。 I still get the alert. 我仍然收到警报。 Only when I restart my computer the alert is off. 仅当我重新启动计算机时,警报才会关闭。

What am I missing? 我想念什么?

MDF files are generally used by a separate SQL Server process. MDF文件通常由单独的SQL Server进程使用。 You would normally change and query data by communicating with this server, not by trying to use it's data files directly. 通常,您可以通过与该服务器通信来更改和查询数据,而不是尝试直接使用其数据文件。

If you can add some more context around your problem -- including what software you are using and what you have tried -- you might get better answers than this. 如果您可以针对问题添加更多的上下文信息(包括您使用的软件和尝试过的软件),则可能会得到比这更好的答案。

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

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