简体   繁体   English

连接IIS和SQL Server

[英]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应用服务器

  1. Windows 2008 R2 Server Windows 2008 R2服务器
  2. IIS 8 IIS 8
  3. Net Framework 4.0 Net Framework 4.0

2. SQL Database Server 2. SQL数据库服务器

  1. Windows 2008 R2 Server Windows 2008 R2服务器
  2. MSSQL 2012 MSSQL 2012

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.

相关问题 IIS6无法与SQL Server 2008连接 - IIS6 can not connect with sql server 2008 SSMS可以,但是本地IIS无法连接到SQL Server - SSMS is OK but Local IIS Cannot Connect to SQL Server IIS 7.5 MVC 5部署的网站将无法连接到SQL Server - IIS 7.5 MVC 5 deployed website will not connect to SQL Server 配置IIS以使用Active Directory帐户连接到SQL Server - Configure IIS to connect to SQL Server using Active Directory account 将IIS 7.5 Web窗体连接到SQL Server的最佳方法 - Best method to connect IIS 7.5 Web Forms to SQL Server IIS SQL Server配置 - IIS SQL Server configuration 如何将HTML5移动Web应用程序连接到IIS服务器以从SQL Server数据库中获取信息? - How to connect html5 mobile web app to an iis server to get info from the sql server database? asp.net Web应用程序中的ADO是否总是使用IIS服务帐户连接到SQL Server? - Does ADO in an asp.net web app always use the IIS service account to connect to SQL Server? 在网络服务下运行的IIS应用程序池无法连接到SQL Server - IIS Application pool running under network service can't connect to SQL Server 将我的asp.net MVC Web应用程序部署到IIS7后,无法将其连接到SQL Server - Unable to connect my asp.net mvc web application to the sql server after deploying it to IIS7
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM