Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi all
I have asp.net web site with sql server data base. One of my table has about 400,000 records. My problem is that whenever I run my qoerys this error thrown in this line:
mySqlDataAdapter.Fill(ds);

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding
What is this error ? is it related to huge records of my table or options of my server.
By the way, my server is localhost.
Is there any one who help me?

What I have tried:

how to fix The timeout period elapsed prior to completion of the operation or the server is not responding
Posted
Updated 27-Apr-16 5:26am
Comments
Nigam,Ashish 27-Apr-16 10:39am    
you need to change connection time out in web config.
Richard Deeming 27-Apr-16 11:28am    
You need to improve the performance of your queries. Since we can't see your queries or your data, we can only give you general guidance on how to approach that; we can't fix it for you.

This is probably a good place to start:
Performance Tuning for SQL Server by Brent Ozar Unlimited[^]

Also, if your query is trying to load all 400,000 records into memory, then you're almost certainly doing it wrong. :)
Sergey Alexandrovich Kryukov 27-Apr-16 11:33am    
Very likely, it's totally unrelated to timing. See, "error thrown in this line"... Exception is thrown...
—SA

C#
SqlDataAdapter adp = new SqlDataAdapter();
adp.SelectCommand.CommandTimeout = 0;  // Set the Time out on the Command Object
 
Share this answer
 
Comments
Nigam,Ashish 27-Apr-16 10:47am    
Check Connection timeout also with this change.
rezaeti 27-Apr-16 10:53am    
thanks for reply
I check and then coming
rezaeti 27-Apr-16 11:53am    
hi thanks I set adp.SelectCommand.CommandTimeout = 0
and set findcmd.CommandTimeout = 0;
and all things is ok and error solved
so thanks
rezaeti 27-Apr-16 11:07am    
hierror yet remaind but shift to this line :
SqlDataReader dr = findcmd.ExecuteReader();
rezaeti 27-Apr-16 11:09am    
I mention that all things is ok, but when I dont run for about 30 seconds and then run , this error display
 
Share this answer
 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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