简体   繁体   中英

Connect IIS and SQL server

We have a two different new server we bought it to run the web application.

1. IIS Application Server

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

2. SQL Database Server

  1. Windows 2008 R2 Server
  2. 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? 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. Then you need a connection string in your web.config file something like this:

<connectionStrings>
  <add name="cstring" connectionString="server=myserver.domain.com;database=databasename;uid=sql_technical_username;pwd=password" providerName="System.Data.SqlClient"/>
</connectionStrings>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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