System.Data.SqlClient.SqlException: Login failed for user

前端 未结 10 2356
难免孤独
难免孤独 2020-12-01 14:11

Working with my project in debug I have no issues. However running it in IIS I am getting this error:

System.Data.SqlClient.SqlException: Login failed for us

10条回答
  •  孤街浪徒
    2020-12-01 14:43

    I tried some of the suggested answers but it didn't resolve the issue. Finally I found out that the default connection timeout (not command timeout) is 15 seconds and once I increased it to 60 it almost never happened again. simply add this to you connection string: ;Connection Timeout=60 I chose 60 seconds but you can put any value you think would fit the best to your needs.

提交回复
热议问题