Click here to Skip to main content
15,883,705 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Executing a procedure in SQL takes 50 seconds in getting completed and returns 5000 records.

when I call same procedure using Linq in C#, it throws Timeout Exception, below is the detail.

System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

Please help me how to fix it.

Thanks.
Posted

1 solution

 
Share this answer
 
Comments
NAPorwal(8015059) 8-Sep-14 13:29pm    
I did same and modified connection string in web.config but does not seem to be working

connectionString="Data Source=(local);Initial Catalog=Databasename;Persist Security Info=True;User ID=user;Password=passwd;Connection Timeout=60"
Mehdi Gholam 8-Sep-14 13:33pm    
Try a higher value, and also look at this : http://www.codeproject.com/Articles/26283/Change-The-Default-CommandTimeout-of-LINQ-DataCont

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