Click here to Skip to main content
15,919,341 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What should the value of Connection Timeout?

"Data Source=server ;Initial Catalog=AdventureWorks;"
        + "Integrated Security=SSPI;Connection Timeout=30";

This is my connection string.
My database is on other machine in Lan.
Posted
Updated 29-Sep-12 3:24am
v2
Comments
Sandeep Mewara 29-Sep-12 9:31am    
What should the value of Connection Timeout?
In what context? Whats the issue that you are trying to resolve?

Even on a very slow network, the default 15 seconds is usually plenty. If you use the 30 that you have set, go for it. The only downside to increasing this value is that you have to wait that full timeout length to see an error if the connection attempt fails.
 
Share this answer
 
Comments
Espen Harlinn 29-Sep-12 12:27pm    
Good point :-D
fjdiewornncalwe 29-Sep-12 13:42pm    
Thanks Espen
Connection Time Out
Gets the time to wait while trying to establish a connection before terminating the attempt and generating an error.
You can Write that as You want.
You can Refer
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectiontimeout(v=vs.71).aspx[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900