Solved

query using php or asp.net

Posted on 2011-09-17
5
159 Views
Last Modified: 2012-05-12
is there a setting to extend timeout on query using php or asp.net

I want query to run for long time because I am getting timeout error.
0
Comment
Question by:rgb192
5 Comments
 
LVL 4

Accepted Solution

by:
Fugas earned 167 total points
ID: 36555666
in php.ini it is max_execution_time in seconds. On MSSQL server I don't think you have the timeout set.
0
 
LVL 7

Assisted Solution

by:Kishan Zunjare
Kishan Zunjare earned 167 total points
ID: 36555835
ASP.NET
A sqlConnection has a ConnectionTimeout property. It  is a property which determines the maximum number of seconds your code will wait for a connection to the database to open. It is set in the connectionstring to the database

data source=BROCHIS;initial catalog=Indato;integrated security=SSPI;Connect Timeout=60;

Opening the connection does not do anything in the database yet. That is handled by a SqlCommand, By default this is 30 seconds. When you perform something costly in the database this is the one whose value you’ll have to change.

SqlCommand cmd;

cmd.CommandTimeout = 60;

Hope this will work

0
 
LVL 9

Assisted Solution

by:gery128
gery128 earned 166 total points
ID: 36567108
As correctly pointed out by Kishanzunjare, you need to set ConnectionTimeout property of SqlCommand object should be set as well as Connect Timeout parameter in connectionstring. If you set these properties to 0 (zero), it will execute for indefinate time, which is not recommended.
0
 
LVL 7

Expert Comment

by:Kishan Zunjare
ID: 36567187
Thanks gery128....good catch.

I think that is correct.
0
 

Author Closing Comment

by:rgb192
ID: 36595668
thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Grid querry results 41 78
display data in text field from data base for updating 6 59
Sql query 107 63
date diff with Fiscal Calendar 4 30
I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

773 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