SqlCeReplication.HostName Property

Gets or sets the host name used for the device when connecting to the Publisher.

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

Syntax

'Declaration
Public Property HostName As String
public string HostName { get; set; }
public:
property String^ HostName {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_HostName ()

/** @property */
public void set_HostName (String value)
public function get HostName () : String

public function set HostName (value : String)

Property Value

The host name for the device. The default is no host name.

Remarks

The HostName property is optional. Use this property to set a value for HOST_NAME() in a dynamic filter. For example, if you create a dynamic filter on a merge replication article, you can use HOST_NAME() to filter the data that is replicated. For example, if you specify "LName = HOST_NAME()" for the filter, and you set the HostName property to "Jones" before calling Synchronize, only rows that have "Jones" in the LName column will be present in the subscription. For more information, see "Adding a Filter to an Article" in SQL Server Compact 3.5 SP1 Books Online.

Your application must call the ReinitializeSubscription method if it changes the value of the HostName property after the subscription is created.

Thread Safety

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Vista, Windows Mobile 5.0, Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Mobile 2003 for Pocket PC, Windows CE 5.0
Version Information
.NET Framework and NET Compact Framework
Supported in 3.5
.NET Framework
Supported in 3.0
.NET Compact Framework and .Net Framework
Supported in 2.0

See Also

Reference

SqlCeReplication Class
SqlCeReplication Members
System.Data.SqlServerCe Namespace