DbSyncProvider.SelectScopeInfoCommand Property

Gets or sets an IDbCommand object that contains the query or stored procedure that returns scope metadata from the peer database.

This property is not CLS-compliant.  

Namespace: Microsoft.Synchronization.Data
Assembly: Microsoft.Synchronization.Data (in microsoft.synchronization.data.dll)

Syntax

'Declaration
Public Overridable Property SelectScopeInfoCommand As IDbCommand
'Usage
Dim instance As DbSyncProvider
Dim value As IDbCommand

value = instance.SelectScopeInfoCommand

instance.SelectScopeInfoCommand = value
public virtual IDbCommand SelectScopeInfoCommand { get; set; }
public:
virtual property IDbCommand^ SelectScopeInfoCommand {
    IDbCommand^ get ();
    void set (IDbCommand^ value);
}
/** @property */
public IDbCommand get_SelectScopeInfoCommand ()

/** @property */
public void set_SelectScopeInfoCommand (IDbCommand value)
public function get SelectScopeInfoCommand () : IDbCommand

public function set SelectScopeInfoCommand (value : IDbCommand)

Property Value

An IDbCommand object that contains a query or stored procedure.

Remarks

This command returns information from the scope metadata table, such as the synchronization knowledge and cleanup knowledge that Sync Framework requires. For more information about how scope is used, see "Creating Tracking Tables to Store Metadata" in How to: Provision a Server Database for Collaborative Synchronization (Non-SQL Server).

Example

The following code example specifies the command that selects metadata from the scope table in each peer database. To view this code in the context of a complete example, see How to: Provision a Server Database for Collaborative Synchronization (Non-SQL Server).

SqlCommand selReplicaInfoCmd = new SqlCommand();
selReplicaInfoCmd.CommandType = CommandType.Text;
selReplicaInfoCmd.CommandText = "SELECT " +
                                "scope_id, " +
                                "scope_local_id, " +
                                "scope_sync_knowledge, " +
                                "scope_tombstone_cleanup_knowledge, " +
                                "scope_timestamp " +
                                "FROM Sync.ScopeInfo " +
                                "WHERE scope_name = @" + DbSyncSession.SyncScopeName;
selReplicaInfoCmd.Parameters.Add("@" + DbSyncSession.SyncScopeName, SqlDbType.NVarChar, 100);

sampleProvider.SelectScopeInfoCommand = selReplicaInfoCmd;
Dim selReplicaInfoCmd As New SqlCommand()

With selReplicaInfoCmd
    .CommandType = CommandType.Text
    .CommandText = "SELECT " _
                 & "scope_id, " _
                 & "scope_local_id, " _
                 & "scope_sync_knowledge, " _
                 & "scope_tombstone_cleanup_knowledge, " _
                 & "scope_timestamp " _
                 & "FROM Sync.ScopeInfo " _
                 & "WHERE scope_name = @" + DbSyncSession.SyncScopeName
    .Parameters.Add("@" + DbSyncSession.SyncScopeName, SqlDbType.NVarChar, 100)
End With

sampleProvider.SelectScopeInfoCommand = selReplicaInfoCmd

See Also

Reference

DbSyncProvider Class
DbSyncProvider Members
Microsoft.Synchronization.Data Namespace