I am using VS2005 ASP.NET 2.0.
I have a web application which uses Active Directory Connection.
The application is able to run smoothly on my local machine, including logging in.
However, when I brought my web application to my test server, I am not able to log in and it gave me an error which says
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
What is happening? Is it because the AD I am connecting to does not allow remote connection? I am able to log in when I am on my local machine though.
EDIT:
I am able to connect to the SQL server.
I inserted the following code on my login page_load and there’s no error
SqlConnection thisConnection = new SqlConnection("Data Source=<IP>;Initial Catalog=<database>;User ID=<username>;Password=<password>");
SqlCommand nonqueryCommand = thisConnection.CreateCommand();
thisConnection.Open();
thisConnection.Close();
Thus the error is most likely caused by the AD connection string. Looking for suggestions or solutions.
A database connection string you are using is either incorrect or the database you are attempting to connect to is not accessible.
If you are defining your connection strings in the web.config file, ensure these are relevant for the test environment you have deployed to.