Error: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.Asp Net SqlConnection

When you are trying to connect or access from a Database table which is having large volume of data (more than a lakh), query execution time will be more.

The error ( Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.) occurs when the execution time crosses Timeout Property.

There are two main Timeout property in ADO.NET.

1. Connection Timeout for Connection
2. Timeout for Data Access( Command Object or DataAdapter)

The Former, could be solved by setting ConnectionTimeout Property of Connection object either in on Connection String.

This string will make a connection object to wait 400 seconds to get connected to the database.

Even after this, you may still get the same.
Because this property will set timeout only to Connection object.
So it will wait for xxx seconds for the connection to the database.


2.If this error Timeout Expired still persists, then it is not with the Timeout property of Connection object instead it is with Data Provider objects say in DataAdapter or Command Object

To overcome this , set Command.Timeout='0'(Zero) which makes adapter or command to wait for indefinite time before terminating the attempt to execute a command and generating an error.


Complete Forum Discussion in ASP.NET Error: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.Asp Net SqlConnection


posted by TechieLion @ 12:44 AM,

kick it on DotNetKicks.com

5 Comments:

At May 8, 2009 4:23 AM, Anonymous techii said...

Hi thanks for your help. when i run my program it is not giving any error. But i made exe of the project and installed in another computer. but here when i run my program this error msg is coming..
how can i solve this prolbem. can you give my an example how to declare the sql connection string in vb.net ??

 
At November 7, 2009 10:56 AM, Anonymous Anonymous said...

I found this site using [url=http://google.com]google.com[/url] And i want to thank you for your work. You have done really very good site. Great work, great site! Thank you!

Sorry for offtopic

 
At November 9, 2009 11:16 AM, Anonymous Anonymous said...

cheap viagra canada viagra on line viagra cheap price iframe viagra faq mexico viagra viagra logo viagra and cialis viagra free pills viagra lawyer ohio 18 takes viagra fda on viagra free sample pack of viagra buy viagra now uk alternative viagra

 
At November 21, 2009 3:47 AM, Anonymous Anonymous said...

Who knows where to download XRumer 5.0 Palladium?
Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!

 
At November 27, 2009 2:26 AM, Anonymous Anonymous said...

[url=http://community.bsu.edu/members/buy+online+Viagra.aspx]Viagra order overnight shipping[/url]

 

Post a Comment

Links to this post:

Create a Link

<< Home