Query timeout expired error on SQL Server via ASP page I am getting the error


  [Microsoft][Sql Server Native Client 11.0]
  Query timeout expired


on SQL Server via ASP page. Most of the time it is working fine but sometimes I am getting this error. Can anyone tell me If this a SQL Server issue or ASP.NET issue?

I have run the same query in SSMS, it completed within seconds. ASP page can query anything. I am using sa user for auth, so I think it has full permissions.
This can be issue with both depending on how you look at it.  You are getting a 'Query timeout' and not a 'Connection timeout'.
You have 2 options.


Increase your query timeout setting.  Most of the time by default it
is 30 seconds. See this links for 
ODBC and
SqlCommand.
Set up an Extended Event trace (If you are not comfortable, do a
server side  trace with proper filters) and find the query that is
timing out.  Work on improving the run time till it is below 'Query Timeout' setting.  There were times I was
able to capture the query with out trace and just by using sp_whoisactive.  I was watching
total run time.