Solved

SqlException Timeout expired

Posted on 2006-06-27
5
1,935 Views
Last Modified: 2008-01-09
Hello peps,

I got a gridview control that uses an SqlDataSource.  The SqlDataSource is set to an store procedure on SQL 2005 server.  Here is the connection string:
Data Source=RM-SQL01\SQL05;Initial Catalog=Lists;Persist Security Info=True;User ID=*****;Password=*******;Connection Timeout=120;

As you can see I did put the connection timeout equal to 120 mins.  But still times out in about 30 sec.

This is happening because the store procedure is compiling.  After the first user compiles the sp than other users should fly.

I noticed this happens in the beginning of the week, seems that SQL Server is deleting the compiled sp out of it's memory during the weekend when no one is using the sp.  Is there away to tell SQL server to keep the compiled sp indefintly, then if things change I manually compile the sp?

Or is there another timeout property I am missing?  I cant find a timeout property in the SqlDataSource Control.

Thanks in advance
0
Comment
Question by:boricua1213
  • 2
5 Comments
 
LVL 2

Author Comment

by:boricua1213
Comment Utility
Well I figured how to set command timeout on sqlDataSource:

Add a Selecting Event to the SqlDataSource and then add

    Protected Sub FailedCalls_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs) Handles FailedCalls.Selecting
        e.Command.CommandTimeout = 120
    End Sub

FailedCalls is the SqlDataSource

Any idea how to keep the sp in memory, cause it takes about 50 secs to compile after compile the sp flys?
0
 
LVL 6

Accepted Solution

by:
Nandakumar Sakthivel earned 500 total points
Comment Utility
Hi,
   Set the command timeout as 0 it will wait indefinitely

Thanks,
Nanda
0
 
LVL 6

Expert Comment

by:Nandakumar Sakthivel
Comment Utility
Volunteer,
           I think that trying my solution will help in  solving the problem.

Thanks,
Nanda
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now