ASP SQL connection string to Windows Server 2022 Datacenter Azure Edition

Product Support 0 Reputation points
2024-04-18T17:46:52.3166667+00:00

I have an ASP website residing on a Windows Server 2022 Datacenter Azure Edition. The website is linked to a SQL database on the same server. When trying to log in, the connection fails with message "Exception:Thrown: "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: TCP Provider, error: 0 - The wait operation timed out.)" (System.Data.SqlClient.SqlException)".

The following connection worked during initial testing but has since stopped working.

*

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,744 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Vahid Ghafarpour 17,950 Reputation points
    2024-04-18T18:13:41.6333333+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    Did you enabled the remote access for your SQL Server?

    https://learn.microsoft.com/en-us/azure/azure-sql/database/azure-sql-dotnet-quickstart?view=azuresql&tabs=visual-studio%2Cpasswordless%2Cservice-connector%2Cportal#configure-the-database

    ** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful **

    0 comments No comments

  2. ZoeHui-MSFT 33,126 Reputation points
    2024-04-19T02:11:52.17+00:00

    Hi @Product Support,

    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: TCP Provider, error: 0 - The wait operation timed out.)" (System.Data.SqlClient.SqlException)

    It is a general issue, you may follow the official documentation to troubleshoot.

    A network-related or instance-specific error occurred while establishing a connection to SQL Server

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments