![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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? |
#3
| |||
| |||
|
|
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? |
#4
| |||
| |||
|
|
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? |
#5
| |||
| |||
|
|
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. |
#6
| |||
| |||
|
|
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 |
#7
| |||
| |||
|
|
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 |
#8
| |||
| |||
|
|
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 |
#9
| |||
| |||
|
|
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 |
#10
| |||
| |||
|
|
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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |