?
Solved

query using php or asp.net

Posted on 2011-09-17
5
Medium Priority
?
163 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 668 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 668 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 664 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

765 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