Solved

SqlException Timeout expired

Posted on 2006-06-27
5
1,939 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 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 500 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

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.…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

751 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