简体   繁体   English

如何在IIS中与数据库一起部署asp .net网站?

[英]how to deploy asp .net website alongwith database in IIS?

When I run website in browser, following server error occured - 当我在浏览器中运行网站时,发生以下服务器错误-

Server Error in '/FinalHVA' Application.
--------------------------------------------------------------------------------

Cannot open database "HVAdb" requested by the login. The login failed.
Login failed for user 'COMP1\ASPNET'. 

似乎comp1 \\ aspnet用户没有登录到HVAdb数据库的权限。

Can you post your web.config file , specifically the Database Connections, it looks like the login credentials being passed to the database is the Machine\\ASPNET account 您可以发布您的web.config文件(特别是数据库连接)吗,好像传递给数据库的登录凭据是Machine \\ ASPNET帐户

A Standard Connection String will look like this: 标准连接字符串如下所示:

Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

If you want to use the credentials of the user accessing the web application, you should use: 如果要使用访问Web应用程序的用户的凭据,则应使用:

Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI; 

Note - you should disable anonymous access on the virtual directory if you would like to use a trusted connection ie the second one. 注意-如果要使用受信任的连接(即第二个连接),则应在虚拟目录上禁用匿名访问。

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

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