Solved

query using php or asp.net

Posted on 2011-09-17
5
161 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
[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
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
spx for moving values to new table 5 76
Grid querry results 41 85
Analysis of table use 7 68
how to eliminate duplicates in a string variable in t-sql? 30 89
When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 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