NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DBDataSetCommand.Clone

Creates a new instance of this ADODataSetCommand object.

[Visual Basic]
Overrides Public Function Clone() As Object
[C#]
public override object Clone();
[C++]
public: override Object* Clone();
[JScript]
public override function Clone() : Object;

Remarks

The new instance of the object will contain all insert, update, delete, and select commands; table mappings; the missing schema action; and the missing mapping action.

Example [Visual Basic]

The following example uses an ADODataSetCommand that attempts to resolve discrepancies between the data set and the data source. This example then creates an ADODataSetCommand that throws an error any time a discrepancy occurs.

[Visual Basic]

Sub CreateClonedDataSetComm (mySelectComm As String, _
      myConnection As String)
    ' Create an ADODataSetCommand to resolve discrepancies
    Dim optDataSetComm As ADODataSetCommand
    ' Create an ADODataSetCommand to error on all discrepancies
    Dim pesDataSetComm As ADODataSetCommand
    ' Initialize the optimistic data set command
    optDataSetComm = New ADODataSetCommand mySelectComm, myConnection
    ' Set missing schema and mapping actions to optimistic view
    optDataSetComm.MissingMappingAction = MissingMappingAction.Passthrough
    optDataSetComm.MissingMappingSchema = MissingMappingSchema.Add
    ' Initialize the pessimistic data set command
    pesDataSetComm = New ADODataSetCommand
    ' Clone the data set command
    pesDataSetComm = optDataSetCommand.Clone
    ' Set missing schema and mapping actions to pessimistic view
    pesDataSetComm.MissingMappingAction = MissingMappingAction.Error
    pesDataSetComm.MissingSchemaAction = MissingSchemaAction.Error
 End Sub

See Also

DBDataSetCommand Class | DBDataSetCommand Members | System.Data.Internal Namespace | InsertCommand | DeleteCommand | SelectCommand | UpdateCommand | TableMappings | MissingSchemaAction | MissingMappingAction