dbTalk Databases Forums  

Connection Timeout

microsoft.public.sqlserver.clients microsoft.public.sqlserver.clients


Discuss Connection Timeout in the microsoft.public.sqlserver.clients forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
tc
 
Posts: n/a

Default Connection Timeout - 07-24-2007 , 12:46 PM






Hi all.

I have a PPC app which connects to an SQL server via RF. App is fine, but
when
out of range the connection timeout is too long. I don't want to backlog
data, in this instance the user must be within range for the connection to
work. Using CF SQLClient namespace.

I've had a look at the general sql client connection properties, but I can't
find a way to reduce the connection timeout to say, 5 seconds.

Any ideas?




Reply With Quote
  #2  
Old   
Andrew J. Kelly
 
Posts: n/a

Default Re: Connection Timeout - 07-24-2007 , 01:52 PM






See if this answers your question:
http://classicasp.aspfaq.com/general...ut-values.html


--
Andrew J. Kelly SQL MVP

"tc" <tull (AT) idcodeware (DOT) co.uk> wrote

Quote:
Hi all.

I have a PPC app which connects to an SQL server via RF. App is fine, but
when
out of range the connection timeout is too long. I don't want to backlog
data, in this instance the user must be within range for the connection
to
work. Using CF SQLClient namespace.

I've had a look at the general sql client connection properties, but I
can't
find a way to reduce the connection timeout to say, 5 seconds.

Any ideas?






Reply With Quote
  #3  
Old   
tc
 
Posts: n/a

Default Re: Connection Timeout - 07-25-2007 , 03:47 AM



It's the right idea, but I need to impose this change within my managed VB
code on the portable, I'm not loading data from a web server, just a
standard SQL server on a local network.

Thanks anyway.

"Andrew J. Kelly" <sqlmvpnooospam (AT) shadhawk (DOT) com> wrote

Quote:
See if this answers your question:
http://classicasp.aspfaq.com/general...ut-values.html


--
Andrew J. Kelly SQL MVP

"tc" <tull (AT) idcodeware (DOT) co.uk> wrote in message
news:uDuIIqhzHHA.4712 (AT) TK2MSFTNGP04 (DOT) phx.gbl...
Hi all.

I have a PPC app which connects to an SQL server via RF. App is fine,
but when
out of range the connection timeout is too long. I don't want to backlog
data, in this instance the user must be within range for the connection
to
work. Using CF SQLClient namespace.

I've had a look at the general sql client connection properties, but I
can't
find a way to reduce the connection timeout to say, 5 seconds.

Any ideas?








Reply With Quote
  #4  
Old   
Andrew J. Kelly
 
Posts: n/a

Default Re: Connection Timeout - 07-25-2007 , 08:53 AM



I don't see the distinction for this. It is just a property (CommandTimeOut)
that you set for the connection. It should not matter what the client or the
server is or what they do.

--
Andrew J. Kelly SQL MVP

"tc" <tull (AT) idcodeware (DOT) co.uk> wrote

Quote:
It's the right idea, but I need to impose this change within my managed VB
code on the portable, I'm not loading data from a web server, just a
standard SQL server on a local network.

Thanks anyway.

"Andrew J. Kelly" <sqlmvpnooospam (AT) shadhawk (DOT) com> wrote in message
news:O5nkQPizHHA.3600 (AT) TK2MSFTNGP04 (DOT) phx.gbl...
See if this answers your question:
http://classicasp.aspfaq.com/general...ut-values.html


--
Andrew J. Kelly SQL MVP

"tc" <tull (AT) idcodeware (DOT) co.uk> wrote in message
news:uDuIIqhzHHA.4712 (AT) TK2MSFTNGP04 (DOT) phx.gbl...
Hi all.

I have a PPC app which connects to an SQL server via RF. App is fine,
but when
out of range the connection timeout is too long. I don't want to
backlog
data, in this instance the user must be within range for the connection
to
work. Using CF SQLClient namespace.

I've had a look at the general sql client connection properties, but I
can't
find a way to reduce the connection timeout to say, 5 seconds.

Any ideas?










Reply With Quote
  #5  
Old   
Arild Bakken
 
Posts: n/a

Default Re: Connection Timeout - 07-26-2007 , 04:44 AM



Andrew J. Kelly wrote:
Quote:
I don't see the distinction for this. It is just a property (CommandTimeOut)
that you set for the connection. It should not matter what the client or the
server is or what they do.

The article he pointed you to does indeed describe how to use the
ConnectionTimeout property of the ADODB.Connection object, which is
similar to what you want.

If you are using the SqlConnection object on .NET 2.0 you'll notice that
the ConnectionTimeout property is readonly. What you need to do is
include the connection timeout in the connection string.

"Data Source=SERVERNAME;Initial Catalog=DBNAME;Integrated
Security=SSPI;Connect Timeout=5"

which will give you a 5 second timeout on the connection.


Arild


Reply With Quote
  #6  
Old   
tc
 
Posts: n/a

Default Re: Connection Timeout - 07-27-2007 , 11:48 AM



That explains it perfectly. Many thanks.

"Arild Bakken" <arild.bakken (AT) telecomputing (DOT) no> wrote

Quote:
Andrew J. Kelly wrote:
I don't see the distinction for this. It is just a property
(CommandTimeOut) that you set for the connection. It should not matter
what the client or the server is or what they do.


The article he pointed you to does indeed describe how to use the
ConnectionTimeout property of the ADODB.Connection object, which is
similar to what you want.

If you are using the SqlConnection object on .NET 2.0 you'll notice that
the ConnectionTimeout property is readonly. What you need to do is include
the connection timeout in the connection string.

"Data Source=SERVERNAME;Initial Catalog=DBNAME;Integrated
Security=SSPI;Connect Timeout=5"

which will give you a 5 second timeout on the connection.


Arild



Reply With Quote
  #7  
Old   
tc
 
Posts: n/a

Default Re: Connection Timeout - 07-27-2007 , 12:13 PM



It looked so promising!

Is there any chance that the timeout parameter is ignored in the Compact
Framework? I've tried all settings between 5 and 20 seconds, but the
portable still sits there for 90.

Any ideas?

"Arild Bakken" <arild.bakken (AT) telecomputing (DOT) no> wrote

Quote:
Andrew J. Kelly wrote:
I don't see the distinction for this. It is just a property
(CommandTimeOut) that you set for the connection. It should not matter
what the client or the server is or what they do.


The article he pointed you to does indeed describe how to use the
ConnectionTimeout property of the ADODB.Connection object, which is
similar to what you want.

If you are using the SqlConnection object on .NET 2.0 you'll notice that
the ConnectionTimeout property is readonly. What you need to do is include
the connection timeout in the connection string.

"Data Source=SERVERNAME;Initial Catalog=DBNAME;Integrated
Security=SSPI;Connect Timeout=5"

which will give you a 5 second timeout on the connection.


Arild



Reply With Quote
  #8  
Old   
Andrew J. Kelly
 
Posts: n/a

Default Re: Connection Timeout - 07-27-2007 , 12:23 PM



I guess anything is possible but this is a property of the connection so I
highly doubt it. Are you sure it is using the connection you think? Make
sure there isn't code somewhere that is either creating another or new
connection or overriding the settings.

--
Andrew J. Kelly SQL MVP

"tc" <tull (AT) idcodeware (DOT) co.uk> wrote

Quote:
It looked so promising!

Is there any chance that the timeout parameter is ignored in the Compact
Framework? I've tried all settings between 5 and 20 seconds, but the
portable still sits there for 90.

Any ideas?

"Arild Bakken" <arild.bakken (AT) telecomputing (DOT) no> wrote in message
news:%23Cq5Jm2zHHA.4476 (AT) TK2MSFTNGP06 (DOT) phx.gbl...
Andrew J. Kelly wrote:
I don't see the distinction for this. It is just a property
(CommandTimeOut) that you set for the connection. It should not matter
what the client or the server is or what they do.


The article he pointed you to does indeed describe how to use the
ConnectionTimeout property of the ADODB.Connection object, which is
similar to what you want.

If you are using the SqlConnection object on .NET 2.0 you'll notice that
the ConnectionTimeout property is readonly. What you need to do is
include the connection timeout in the connection string.

"Data Source=SERVERNAME;Initial Catalog=DBNAME;Integrated
Security=SSPI;Connect Timeout=5"

which will give you a 5 second timeout on the connection.


Arild





Reply With Quote
  #9  
Old   
tc
 
Posts: n/a

Default Re: Connection Timeout - 07-27-2007 , 12:36 PM



I only use one connection string for the whole app, any connection created
is forced to use this string. I'll do some research on the MS site, wish me
luck!


"Andrew J. Kelly" <sqlmvpnooospam (AT) shadhawk (DOT) com> wrote

Quote:
I guess anything is possible but this is a property of the connection so I
highly doubt it. Are you sure it is using the connection you think? Make
sure there isn't code somewhere that is either creating another or new
connection or overriding the settings.

--
Andrew J. Kelly SQL MVP

"tc" <tull (AT) idcodeware (DOT) co.uk> wrote in message
news:%23Hc3uFH0HHA.4928 (AT) TK2MSFTNGP05 (DOT) phx.gbl...
It looked so promising!

Is there any chance that the timeout parameter is ignored in the Compact
Framework? I've tried all settings between 5 and 20 seconds, but the
portable still sits there for 90.

Any ideas?

"Arild Bakken" <arild.bakken (AT) telecomputing (DOT) no> wrote in message
news:%23Cq5Jm2zHHA.4476 (AT) TK2MSFTNGP06 (DOT) phx.gbl...
Andrew J. Kelly wrote:
I don't see the distinction for this. It is just a property
(CommandTimeOut) that you set for the connection. It should not matter
what the client or the server is or what they do.


The article he pointed you to does indeed describe how to use the
ConnectionTimeout property of the ADODB.Connection object, which is
similar to what you want.

If you are using the SqlConnection object on .NET 2.0 you'll notice that
the ConnectionTimeout property is readonly. What you need to do is
include the connection timeout in the connection string.

"Data Source=SERVERNAME;Initial Catalog=DBNAME;Integrated
Security=SSPI;Connect Timeout=5"

which will give you a 5 second timeout on the connection.


Arild







Reply With Quote
  #10  
Old   
tc
 
Posts: n/a

Default Re: Connection Timeout - 07-27-2007 , 12:46 PM



Well, I can't find anything that says it's not going to work in CF, so I'm
asuming it should, but it doesn't!

"tc" <tull (AT) idcodeware (DOT) co.uk> wrote

Quote:
I only use one connection string for the whole app, any connection created
is forced to use this string. I'll do some research on the MS site, wish
me luck!


"Andrew J. Kelly" <sqlmvpnooospam (AT) shadhawk (DOT) com> wrote in message
news:uwnXuLH0HHA.1484 (AT) TK2MSFTNGP06 (DOT) phx.gbl...
I guess anything is possible but this is a property of the connection so I
highly doubt it. Are you sure it is using the connection you think? Make
sure there isn't code somewhere that is either creating another or new
connection or overriding the settings.

--
Andrew J. Kelly SQL MVP

"tc" <tull (AT) idcodeware (DOT) co.uk> wrote in message
news:%23Hc3uFH0HHA.4928 (AT) TK2MSFTNGP05 (DOT) phx.gbl...
It looked so promising!

Is there any chance that the timeout parameter is ignored in the Compact
Framework? I've tried all settings between 5 and 20 seconds, but the
portable still sits there for 90.

Any ideas?

"Arild Bakken" <arild.bakken (AT) telecomputing (DOT) no> wrote in message
news:%23Cq5Jm2zHHA.4476 (AT) TK2MSFTNGP06 (DOT) phx.gbl...
Andrew J. Kelly wrote:
I don't see the distinction for this. It is just a property
(CommandTimeOut) that you set for the connection. It should not matter
what the client or the server is or what they do.


The article he pointed you to does indeed describe how to use the
ConnectionTimeout property of the ADODB.Connection object, which is
similar to what you want.

If you are using the SqlConnection object on .NET 2.0 you'll notice
that the ConnectionTimeout property is readonly. What you need to do is
include the connection timeout in the connection string.

"Data Source=SERVERNAME;Initial Catalog=DBNAME;Integrated
Security=SSPI;Connect Timeout=5"

which will give you a 5 second timeout on the connection.


Arild









Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.