The connection to the data-tier server failed
The information in this article applies to:
Visual Studio Team Foundation Server 2010
Windows Server 2003 and Windows Server 2008
SQL Server 2008
Team Foundation Server Complete Health Check
Team Foundation Server Framework Health Check
The Best Practices Analyzer tool for Team Foundation Server performs several tests to determine whether the database connection is configured correctly. An information message appears and contains the connection string that is defined in the Web Services Web.config file for Team Foundation.
If the connection is not correctly configured, one of the following errors appears:
Cannot connect to the data tier server
This error indicates that a connection to the database instance could not be made by using the connection string that is defined in the Services Web.config file for Team Foundation. If this error appears, you should investigate the following possible causes first:
The data-tier server is not available.
SQL Server is not running on the data-tier server.
The name of the database instance that is defined in the application-tier Web services Web.config file is not correct.
To resolve this issue, verify the connection to the database instance. For more information, see Verifying That You Can Connect to the Database Instance. If the database instance is available and SQL Server is running, you must change the name of the data source that is defined in the Web Services Web.config file so that the name points to the data-tier server. For more information, see Correcting the Connection String in the Web Services Web.config File.
The service account for Team Foundation Server has no SQL login
This error indicates that the identity that is assigned to the application pool for Team Foundation Server does not match the SQL Login account for Team Foundation Server on the data-tier server. This condition occurs most often when a user changes the identity of the application pool manually, instead of by using the TFSConfig Accounts command.
To resolve this issue, run the TFSConfig Accounts command to reset the service account that is assigned to the application pool. For more information, see the following topic on the Microsoft Web site: Change the Service Account or Password for Team Foundation Server.
To perform these procedures, you must be a member of the Administrators security group on the data-tier or application-tier server for Team Foundation.
Verifying That You Can Connect to the Database Instance
To verify a connection to the database instance
Log on to the data-tier server.
Open the Start menu, point to All Programs, point to Microsoft SQL Server 2008, and then click SQL Server Management Studio.
The Connect to Server dialog box opens.
Under Server type, click Database Engine, type the name of the server to which you want to connect, and then click Connect.
If SQL Server is installed on a cluster, type the name of the cluster and not the computer name. If you have specified a named instance, type the server and instance name in the following format: DatabaseServer\InstanceName.
SQL Server Management Studio opens.
In Object Explorer, verify that a green arrow appears next to the server name.
If you cannot connect to the server, verify the firewall settings, and then try to connect again.
Correcting the Connection String in the Web Services Web.config File
To change the server name that is defined in the connection string key of the Services Web.config file
Log on to the application-tier server.
Open Windows Explorer, and locate the Services directory.
By default, this directory is in the following location:
Drive:\%ProgramFiles%\Microsoft Team Foundation Server 2010\Application Tier\Web Services
Open the web.config file in Notepad or any text-based editor.
Even if you are logged on with administrative credentials, you must open Notepad as an administrator to perform this function on a server that is running Windows Server 2008. To open Notepad as an administrator, click Start, right-click Command Prompt, and click Run as administrator. For more information, see the Microsoft Web site.
Under the appSettings node, locate the applicationDatabase key.
Change the value that is assigned to the Data Source to point to the database instance.
The format is ComputerName\TFSInstance. For the default instance, the format is ComputerName. This value must match the value that is defined in the tbl_CatalogServiceReference table of the Tfs_Configuration database.
Save the file, and close Notepad.
If the name of the database instance has changed from the value that is defined in the Tfs_Configuration database, run the TFSConfig RemapDBs command.
For more information, see the following topic on the Microsoft Web site: RemapDBs Command.