user2900082
user2900082

Reputation: 11

Unable to connect Sql Server from Asp.net Application - Issue occured frequently

Error:

“System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server.

While running my ASP.NET application from VS2015, I get error like:

"A network-related or instance-specific error occurred".

After refreshed its working as usual without any issue so it seems to not work time to time. I am using SQL Express edition with DB size around 6GB.

I couldn't find the cause of the issue. It working fine some time and doesn't working fine some time.

Is it related to max connection in sql express?
DB size?
Sql connection string - connection pooling?

Upvotes: 0

Views: 150

Answers (1)

Mehdi Souregi
Mehdi Souregi

Reputation: 3265

Things I usually do when this exception occurs :

  1. I check if the parameter Data Source=MyWebServer is well filled on my connection string (code problem)
  2. I make sure that the server can respond to a ping request (network problem):

ping MyWebServer;

  1. I check if the SQL Server(MSSQLSERVER) Service is started on MyWebServer (service problem)

Upvotes: 1

Related Questions