[英]connect to sql server database from asp.net application
I have an sql database running locally. 我有一个在本地运行的sql数据库。 In visual studio, server explorer, I am connected to this database so I am sure of the validity of the connection string which is :
在Visual Studio(服务器资源管理器)中,我已连接到此数据库,因此可以确定连接字符串的有效性:
Data Source=MyMachineName;Initial catalog=MyDBName;Integrated Security=True
However when I am trying to access to the db from my application i am getting the following exception in my browser : 但是,当我尝试从应用程序访问数据库时,在浏览器中出现以下异常:
System.Data.SqlClient.SqlException : Authorization CREATE DATABASE denied in database 'master'
For information, I am running my application through my iis server. 有关信息,我正在通过iis服务器运行我的应用程序。
Thanks in advance for your help 在此先感谢您的帮助
Your IIS site by default is running under ApplicationPoolIdentity user, which does not have rights to your system. 默认情况下,您的IIS站点在ApplicationPoolIdentity用户下运行,该用户没有系统权限。 You can change that user to your user from IIS Manager.
您可以从IIS管理器将该用户更改为您的用户。 First find which "application pool" is your application running on, then go to that application pool in the "Application Pools", right click then select "Advanced Settings", and under "Process Model" you will find the "Identity" record.
首先找到正在运行您的应用程序的“应用程序池”,然后转到“应用程序池”中的该应用程序池,右键单击然后选择“高级设置”,然后在“流程模型”下找到“身份”记录。
PS If you haven't changed the application pool of your site just edit the "DefaultAppPool" PS:如果您尚未更改站点的应用程序池,则只需编辑“ DefaultAppPool”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.