5

I'm confused in those two terms I want to know what is the difference between the timeout inside the connection string and the timeout inside the IIS configuration

data source=xxxx;Initial Catalog=Test;User=yy;Password=yyyy;Timeout=10

enter image description here

2 Answers 2

3

DB connection timeout is very diffrent from IIS time out

DB connection timeout is about establis the connection to DB, from MSDN SqlConnection.ConnectionTimeout

Gets the time to wait while trying to establish a connection before terminating the attempt and generating an error.

From MSDN about Connection Timeout

Connection timeouts help reduce the amount of memory resources that are consumed by idle connections. Time-out settings also allow you to specify how long server resources are allocated to specific tasks or clients.

Sign up to request clarification or add additional context in comments.

8 Comments

if i reduced the Connection time out to 10 sec for example what kind of error or problems may accrue ?
reduce it in DB or IIS ? if DB than if your DB will not response quickly then you will get an error. If IIS then is connection will be idle for the connection timeout period the resources will be free
I meant in IIS not in DB and is there an example where can i throw that error and see how it work ? in my scenario i have a page where i can upload a huge excel file notice huge mean it contains more than 15 000 row and sometime in the upload process it throws that kind of error so we r confused if we should maximize the timeout in connection string or the IIS timeout
Increase the DB timeout - since the IIS connection is not Idle. But, are you trying to save all rows at once?
we had that other problem that we read the excel file and convert it to a DataTable than we use a Stored Procedure to insert those row in the DB but it's too slow i can't change the Stored Procedure code so do u have a best solution for that ?
|
2

The timeout in the database connection string is the amount of time ADO.NET should spend trying to connect to a database server before deciding it is unavailable (which is unrelated to the command timeout, note). Connect in a database connection string is a synonym for Connect Timeout.

The timeout in IIS is how long it should spend trying to process a request before deciding that it has failed.

1 Comment

so if for example i am uploading a large file to the server and that file took more time than the IIS connection time out would it give me an error ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.