共用方式為


SqlCeReplication.ConnectTimeout Property

Gets or sets the amount of time, in milliseconds, that the SqlCeReplication object waits for a connection to the server.

Namespace: System.Data.SqlServerCe
Assembly: System.Data.SqlServerCe (in system.data.sqlserverce.dll)

Syntax

'Declaration
Public Property ConnectTimeout As Integer
'Usage
Dim instance As SqlCeReplication
Dim value As Integer

value = instance.ConnectTimeout

instance.ConnectTimeout = value
public int ConnectTimeout { get; set; }
public:
property int ConnectTimeout {
    int get ();
    void set (int value);
}
/** @property */
public int get_ConnectTimeout ()

/** @property */
public void set_ConnectTimeout (int value)
public function get ConnectTimeout () : int

public function set ConnectTimeout (value : int)
Not applicable.

Property Value

An System:Int32 value that represents the time-out, in milliseconds, with no default.

Remarks

If a response takes longer than the value specified in ConnectTimeout, the request is canceled.

The maximum time-out allowed is 360 seconds. For recommendations on setting this time-out value, see "Optimizing Connectivity" in the SQL Server Compact Edition Books Online.

When you try to connect to a server that has multiple IP addresses (multi-homed), the time-out is counted as cumulative for all the IP addresses on the server. For example, if a server has two IP addresses, spending 500ms on the first IP and 500ms on the second IP equals a time-out value of 1000ms for the server.

Platforms

Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows XP Professional x64 Edition, Windows XP SP2

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

SqlCeReplication Class
SqlCeReplication Members
System.Data.SqlServerCe Namespace