DbSyncProvider.SelectScopeInfoCommand Property
Gets or sets an IDbCommand object that contains the query or stored procedure that returns scope metadata from the peer database.
Namespace: Microsoft.Synchronization.Data
Assembly: Microsoft.Synchronization.Data (in Microsoft.Synchronization.Data.dll)
Syntax
'Declaration
Public Overridable Property SelectScopeInfoCommand As IDbCommand
Get
Set
'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);
}
abstract SelectScopeInfoCommand : IDbCommand with get, set
override SelectScopeInfoCommand : IDbCommand with get, set
function get SelectScopeInfoCommand () : IDbCommand
function set SelectScopeInfoCommand (value : IDbCommand)
Property Value
Type: System.Data.IDbCommand
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).
Examples
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