Sora
Sora

Reputation: 2551

Setting Connection time out programmatically in asp.net

Is there a way to Set Connection timeout used in IIS in asp.net programaticaly in one page ? without setting it globally for all the website from IIS itself ?

Upvotes: 0

Views: 3486

Answers (2)

kostas ch.
kostas ch.

Reputation: 2035

Create a second cpnnection string in your web config with out timeout and in the page you want, add timeout you want.

Upvotes: 0

Freelancer
Freelancer

Reputation: 9074

Update your connection string.

Add Connection Timeout=900 in your connection string.

Connection Timeout always specified in seconds and Default is 30 seconds.

You can set these according to your need.

Your connection string may look like:

server=servername;database=DBName;User ID=UserID;Password=PWD; Connect Timeout=timeinseconds

Hope its helpful.

Upvotes: 1

Related Questions