Sunday, February 19, 2012

DataBase: Timeout Expired

Hi,

When I am trying to query a table which has got lakhs of records,

it said, Error:Timeout Expired . Timeout Expired prior to completion of operation or server is not responding.

Can anybody help me out

You can change/set the timeout property in the connection string. A more important question is, do you really need to show that many hundreds of thousands of records in the application? There are ways like paging that you can only bring in few hundred records at a time.|||

I dont want to display all these results nut, i need to query these many records to display some 100 records.

I have used Timeout in Connection String also.

Connection is fine.

But Query Execution is taking that much time.

Something similar to http://techielion.blogspot.com

Can you please explain that to me?


|||

If you only need 100 records you could do a SELECT TOP 100 ....

If its still taking too long, check your query. Do you have proper indexes on the columns that are in the WHERE condition? Are the indexes up to date? Is there too much fragmentation?

|||

Hi,

You also need to check the ConnectionTimeout and CommandTimeout property to see if it is too small to return all the results.