473,378 Members | 1,119 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

SQL Connection Timeout

Hello,

I have a website I'm developing that will query a SQL database for basic
lists. If the database is unavailable, the site will continue to function as
a static site. The problem I'm running into is that when the SQL server is
unavailable, it takes a while for the page to load. I'm assuming its the
connection timeout for the SQL client. Defaults to 60 seconds? I don't know.
How can I specify the timeout to be like 5 seconds? I'm aware of the script
timeout property but I just want to specify the timeout for the SQL conn,
not the entire page of scripts, if possible.

Thanks,

--
David Lozzi
Web Applications Developer
dlozzi@(remove-this)delphi-ts.com


Dec 8 '05 #1
2 2566
KJ
SqlConnection sc = new SqlConnection();
sc.ConnectionTimeout = 5;

-KJ

Dec 8 '05 #2
Hi David,

I agree with KJ, as for connecting to a certain SqlServer instance, the
connecting timeout is specified by the SqlConnection class's
ConnectionTimeout property:
============
The time (in seconds) to wait for a connection to open. The default value
is 15 seconds.
==========

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "KJ" <n_**********@mail.com>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Subject: Re: SQL Connection Timeout
| Date: 7 Dec 2005 18:47:52 -0800
| Organization: http://groups.google.com
| Lines: 5
| Message-ID: <11**********************@g14g2000cwa.googlegroups .com>
| References: <Op*************@TK2MSFTNGP10.phx.gbl>
| NNTP-Posting-Host: 66.65.235.143
| Mime-Version: 1.0
| Content-Type: text/plain; charset="iso-8859-1"
| X-Trace: posting.google.com 1134010077 17057 127.0.0.1 (8 Dec 2005
02:47:57 GMT)
| X-Complaints-To: gr**********@google.com
| NNTP-Posting-Date: Thu, 8 Dec 2005 02:47:57 +0000 (UTC)
| In-Reply-To: <Op*************@TK2MSFTNGP10.phx.gbl>
| User-Agent: G2/0.2
| X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.7.8) Gecko/20050511 Firefox/1.0.4,gzip(gfe),gzip(gfe)
| Complaints-To: gr**********@google.com
| Injection-Info: g14g2000cwa.googlegroups.com; posting-host=66.65.235.143;
| posting-account=-EvJ3wsAAABogc-QthV-9_6Q4JSAQJuo
| Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfee d00.sul.t-online.de!t-onli
ne.de!border2.nntp.dca.giganews.com!border1.nntp.d ca.giganews.com!nntp.gigan
ews.com!postnews.google.com!g14g2000cwa.googlegrou ps.com!not-for-mail
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:363543
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| SqlConnection sc = new SqlConnection();
| sc.ConnectionTimeout = 5;
|
| -KJ
|
|

Dec 8 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dicky Cheng | last post by:
Hi, I am using .net remoting technology. I set up a .net remoting client and server in IIS. When the client calls the server, the server will run a long duration method (30-60seconds). I have a...
3
by: kant | last post by:
stringA= "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;PWD=password;Initial Catalog=DB;Data Source=127.0.0.1;Connect Timeout=30" stringB = "Provider=Microsoft.Jet.OLEDB.4.0; Data...
6
by: Nifty | last post by:
After creating a routine to select from past ADODB connection strings, I found that it takes 60 seconds to timeout! I found the Microsoft article below ...
7
by: C# beginner | last post by:
I'm struggling with a timeout problem today. ConnectionString = "Integrated Security=true;Database=MyDatabase;Data Source=(local); Connection Timeout = 180;"; My connection string is set as...
7
by: ZRexRider | last post by:
Hi, I'm developing an application that runs on laptops that periodically connect to network. I am collecting data in local tables within the MDB. I want to recognize the occasional network...
0
by: Christopher H. Laco | last post by:
I'm in a strange situation. I have a dataset that uses it own connection string from MySettings. All is well. This thing works in .NET just dandy. If I reference this dataset from another...
3
by: Martin B | last post by:
Hallo! I'm working with C# .NET 2.0, implementing Client/Server Applications which are connecting via Network to SQL-Server or Oracle Databases. To stay independent from the underlaying Database...
6
by: michael sorens | last post by:
I have used the visual designer to create a series of DataGridViews populated from SQLServer data. A typical call is: myCountsTableAdapter.Fill(myDataSet.myCounts); My application actually...
4
by: Fred Zuckerman | last post by:
I have a A2K database that includes some linked tables (these links are SQL views). Sometimes there are "issues" with the SQL server and the users receive a timeout error whenever they try to...
7
by: =?Utf-8?B?Sm9obiBTdGFnZ3M=?= | last post by:
Hello, Please read this all before giving an answer :) I'm doing some troubleshooting on a web application that my company wrote. It's written in asp.net 1.1. The error that the Event viewer...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.