App_Data文件夹中的SQL DB [英] SQL DB in App_Data Folder

查看:72
本文介绍了App_Data文件夹中的SQL DB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SQL SERVER 2008和MS Visual Studio2008.我已经创建了一个数据库和该数据库中的一些表.这些表是空的.
我在Web开发中创建了一个Project,并试图将数据库添加到App_Data文件夹中.

导航到数据库mdf文件并单击它后,我收到拒绝访问"消息,并且在我单击拒绝访问"消息后,添加对话框消失.


有关如何解决此问题的任何建议?

我可以毫无问题地连接到Access .mdb文件.

I am using SQL SERVER 2008 and MS Visual Studio 2008. I have created a database and some tables in the database. The tables are empty.
I created a Project in Web development and attempted to add the database into the App_Data folder.

After I navigated to the database mdf file and clicked on it I receive an "Access Denied" message and the add dialog disappears after I OK the Access Denied message.


Any suggestions on how to get around this problem?

I can connect to an Access .mdb file with no problem

推荐答案

在远程调用中可能会出现错误消息.它可能在本地工作正常.这是由于在SQL Server外围应用配置中未启用远程连接这一事实.为此,请按照以下步骤操作:

确保您的数据库引擎配置为接受远程连接:•启动>所有程序> SQL Server 2008>配置工具> SQL Server外围应用配置器•单击服务和连接的外围应用配置器"•选择出现问题的实例>数据库引擎远程连接•启用本地和远程连接•重新启动实例

或者,如果您使用命名的SQL Server实例,请确保在ASweb P.NET应用程序的连接字符串中使用该实例名称•通常,指定数据库服务器所需的格式为machinename \ instancename•检查您的连接字符串以及
Error message might occur on a remote call. It may work locally fine. This is due to the fact that the remote connections are not enabled on the SQL Server surface Area configuration. To accomplish this, please follow below steps:

Make sure your database engine is configured to accept remote connections: • Start > All Programs > SQL Server 2008 > Configuration Tools > SQL Server Surface Area Configuration • Click on Surface Area Configuration for Services and Connections • Select the instance that is having a problem > Database Engine > Remote Connections • Enable local and remote connections • Restart instance

Alternatively, if you are using a named SQL Server instance, make sure you are using that instance name in your connection strings in your ASweb P.NET application • Usually the format needed to specify the database server is machinename\instancename • Check your connection string as well


这篇关于App_Data文件夹中的SQL DB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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