问题描述
我直接将数据库上传到App_Data文件夹,然后更改了错误.它开始给出一些连接错误.有人请告诉我如何使用ASPNETDB.mdf ???我不知道数据库应该在服务器上自动创建的一件事?还是我应该将创建的mdf文件上传到服务器?这个问题使我的工作停止了三天.
大家好,
每当我运行我的应用程序时,都会出现以下错误.但是在我的本地PC上,它运行良好.我不知道如何解决.有人可以帮我吗?错误是这样的.它正在App_Data文件夹中创建1个mdf文件,但是在服务器上它给出了以下错误.
SQLExpress数据库文件自动创建错误:
连接字符串使用应用程序App_Data目录中的数据库位置指定本地Sql Server Express实例.提供者尝试自动创建应用程序服务数据库,因为提供者确定该数据库不存在.要成功检查应用程序服务数据库的存在并自动创建应用程序服务数据库,必须满足以下配置要求:
如果应用程序App_Data目录尚不存在,则Web服务器帐户必须具有对应用程序目录的读写访问权限.这是必要的,因为Web服务器帐户将自动创建App_Data目录(如果尚不存在).
如果应用程序App_Data目录已经存在,则Web服务器帐户仅需要对应用程序App_Data目录的读写访问权限.这是必需的,因为Web服务器帐户将尝试验证应用程序App_Data目录中是否已存在Sql Server Express数据库.从Web服务器帐户撤消对App_Data目录的读取访问权限,将阻止提供程序正确确定Sql Server Express数据库是否已存在.当提供程序尝试创建已经存在的数据库的副本时,这将导致错误.需要写访问权限,因为在创建新数据库时会使用Web服务器帐户凭据.
必须在计算机上安装Sql Server Express.
Web服务器帐户的进程标识必须具有本地用户配置文件.有关如何为计算机帐户和域帐户创建本地用户配置文件的详细信息,请参见自述文档.
在此先谢谢您.
I uploaded database directly to App_Data folder then error changed. It started giving some connection error. Anybody please tell me how to work with ASPNETDB.mdf??? 1 thing i dont know database should create on server automatically? or I should upload created mdf file to the server?? This problem has stopped my work for last 3 days.
HI all,
whenever I am running my application i am getting following error. But on my local pc its running well. i dont know how to solve it. Anybody can please help me? The error is like this.. It is creating 1 mdf file in App_Data folder but on server its giving following error.
SQLExpress database file auto-creation error:
The connection string specifies a local Sql Server Express instance using a database location within the applications App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The following configuration requirements are necessary to successfully check for existence of the application services database and automatically create the application services database:
If the applications App_Data directory does not already exist, the web server account must have read and write access to the applications directory. This is necessary because the web server account will automatically create the App_Data directory if it does not already exist.
If the applications App_Data directory already exists, the web server account only requires read and write access to the applications App_Data directory. This is necessary because the web server account will attempt to verify that the Sql Server Express database already exists within the applications App_Data directory. Revoking read access on the App_Data directory from the web server account will prevent the provider from correctly determining if the Sql Server Express database already exists. This will cause an error when the provider attempts to create a duplicate of an already existing database. Write access is required because the web server accounts credentials are used when creating the new database.
Sql Server Express must be installed on the machine.
The process identity for the web server account must have a local user profile. See the readme document for details on how to create a local user profile for both machine and domain accounts.
Thanks in advance.
推荐答案
这篇关于SQLExpress数据库文件自动创建错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!