Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SqlException Timeout expired

Posted on 2006-06-27
5
Medium Priority
?
1,944 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
3 Comments
 
LVL 2

Author Comment

by:boricua1213
ID: 16994694
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 2000 total points
ID: 17000871
Hi,
   Set the command timeout as 0 it will wait indefinitely

Thanks,
Nanda
0
 
LVL 6

Expert Comment

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

Thanks,
Nanda
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

783 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