Billa
Billa

Reputation: 5266

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

Upvotes: 0

Views: 125

Answers (1)

Las Ten
Las Ten

Reputation: 1175

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>

Upvotes: 0

Related Questions