SqlCeReplication.LoadProperties Method

Retrieves all values stored for the synchronization properties, and then populates the Replication class properties with these saved values.

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


Public Function LoadProperties As Boolean
Dim instance As SqlCeReplication
Dim returnValue As Boolean

returnValue = instance.LoadProperties
public bool LoadProperties ()
bool LoadProperties ()
public boolean LoadProperties ()
public function LoadProperties () : boolean


For the LoadProperties function to succeed, you must provide all of the Replication object properties unless the database specified in the SubscriberConnectionString has only one subscription. If the database subscribes to only one publication, you can omit the following properties:

If LoadProperties is called without setting these properties, and more than one subscription exists in the database, an error is raised for each subscription in the database. Each error in the collection contains the string parameters of the Publisher, Publication, and PublisherDatabase properties for each subscription in the database.

When SaveProperties is called, the values for the password properties are stored in the database. These values are automatically encrypted with the unique device hardware key. Therefore, if you create a subscription profile on one device (or a server), and then copy the database to a new device, LoadProperties will fail to retrieve the password from the profile. You can provide the correct password manually and then call SaveProperties again to persist the profile on the new device.


The following example shows how to use the LoadProperties method.

    Dim repl As New SqlCeReplication()
    repl.SubscriberConnectionString = "Data Source='Test.sdf'; Pwd='<password>'"

    ' Handle errors here
End Try
    SqlCeReplication repl = new SqlCeReplication();
    repl.SubscriberConnectionString = "Data Source='Test.sdf'; Pwd='<password>'";


catch (SqlCeException)
    // Handle errors here

.NET Framework Security

  • Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see .


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

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

Version Information

.NET Compact Framework

Supported in: 2.0

See Also


SqlCeReplication Class
SqlCeReplication Members
System.Data.SqlServerCe Namespace