为什么从 Visual Studio 连接到 SQL Server 时出现权限错误? [英] Why do I get a permission error when connecting to SQL Server from Visual Studio?

查看:32
本文介绍了为什么从 Visual Studio 连接到 SQL Server 时出现权限错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 SQL Server 2005 SP4 Express,当我尝试建立从 VS2010 到我的数据库的连接时,出现错误:

I have SQL Server 2005 SP4 Express, when I try to establish connection from VS2010 to my database, I get a error:

您无权打开此文件

联系文件所有者或管理员以获得许可.

Contact the file owner or an administrator to obtain permission.

我正在使用 Windows 身份验证并且我是唯一的用户.

I am using windows authentication and I am the only user.

请帮助我克服这个错误.

Please help me out to overcome this error.

有时也显示文件已打开

推荐答案

首先关闭visual studio.现在打开以管理员身份运行的visual studio.如果还没有解决您的问题,请打开 sql server management studio 并按照步骤操作.

First of all close visual studio. Now open visual studio run as administrator. If it not solved your problem then open sql server management studio and follow the steps.

  1. 扩展您的数据库.
  2. 右键单击您的数据库并选择属性选项.
  3. 弹出窗口打开,选择位于左侧的选项菜单.
  4. 将自动关闭选项设为 true 位于自动窗格中.

我相信你的问题现在已经解决了......

I am sure your problem is solved now.....

干杯……

这篇关于为什么从 Visual Studio 连接到 SQL Server 时出现权限错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆