[英]Connect IIS and SQL server
We have a two different new server we bought it to run the web application. 我们购买了两台不同的新服务器来运行Web应用程序。
1. IIS Application Server 1. IIS应用服务器
2. SQL Database Server 2. SQL数据库服务器
The problem is both the server are in a different. 问题是两个服务器都在不同的位置。 What should we do inorder to allow IIS server to access the SQL server via connection string?
为了允许IIS服务器通过连接字符串访问SQL Server,我们应该怎么做? What settings needs to be done.
需要完成哪些设置。
We also need to access both the server through virtual machine connection. 我们还需要通过虚拟机连接访问两个服务器。
We are not specialized in server management. 我们不专门从事服务器管理。 Any help please
任何帮助请
First, make sure the web server can access the database server on the network and the database server listens on TCP/IP. 首先,确保Web服务器可以访问网络上的数据库服务器,并且数据库服务器侦听TCP / IP。 Then you need a connection string in your web.config file something like this:
然后,您需要在web.config文件中添加如下所示的连接字符串:
<connectionStrings>
<add name="cstring" connectionString="server=myserver.domain.com;database=databasename;uid=sql_technical_username;pwd=password" providerName="System.Data.SqlClient"/>
</connectionStrings>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.