Solved

time out expired when execute stored procedure

Posted on 2008-10-23
3
826 Views
Last Modified: 2012-05-05
hi guys i have a stored procedure that basically has a select statement. i know my table is very big it could be well more than 1million rows. but the statement only runs for 2 mintues and already i get a time out. even though i set my timeout very high. here is the code for the function and the time out. please help me if you know what i did wrong. thank you very much
<httpRuntime executionTimeout="100000000" />  this is in the web.config
 

this below is in my default.aspx.vb .

query parameter is just a select like select * from table1.

    Public Function GetDataTable(ByVal query As String) As DataTable
 

        Dim adapter1 As New SqlDataAdapter

        adapter1.SelectCommand = New SqlCommand(query, allfunctions.SQLConnection)

        Dim table1 As New DataTable

        allfunctions.SQLConnection.Open()

        Try

            adapter1.Fill(table1)

        Finally

            allfunctions.SQLConnection.Close()

        End Try

        Return table1

    End Function

Open in new window

0
Comment
Question by:StewSupport
  • 2
3 Comments
 
LVL 59

Accepted Solution

by:
Kevin Cross earned 500 total points
ID: 22792578
Try also setting the SelectCommand.Timeout value --

adapter1.SelectCommand.CommandTimeout = 100000000
0
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 22792579
Other place to check is the IIS script timeout.
0
 
LVL 26

Expert Comment

by:Anurag Thakur
ID: 22792763
what kind of time out you are talking about (there are 3 kinds)
1. Sessiontimeout controlled by IIS
2. IIS thread execution timeoout
3. DB Command timeout

1. Can be controlled through timeout in the following (in seconds)
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="2000" />

2. Can be controlled by setting the executionTimeout (in seconds) (I think u might need to set this)
<httpRuntime executionTimeout="XXX" />

3. Can be controlled by setting the Command Timeout to 0 (means infinite)
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video discusses moving either the default database or any database to a new volume.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

747 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

13 Experts available now in Live!

Get 1:1 Help Now