DataSet.Clone Metod

Definition

Kopierar strukturen för DataSet, inklusive alla DataTable scheman, relationer och begränsningar. Kopierar inga data.

public:
 virtual System::Data::DataSet ^ Clone();
public virtual System.Data.DataSet Clone();
abstract member Clone : unit -> System.Data.DataSet
override this.Clone : unit -> System.Data.DataSet
Public Overridable Function Clone () As DataSet

Returer

En ny DataSet med samma schema som den aktuella DataSet, men ingen av data.

Exempel

I följande exempel skapas en klon av ett DataSet objekts schema.

private void GetClone(DataSet dataSet)
{
    // Get a clone of the original DataSet.
    DataSet cloneSet = dataSet.Clone();

    // Insert code to work with clone of the DataSet.
}
Private Sub GetClone(ByVal dataSet As DataSet)
   ' Get a clone of the original DataSet.
   Dim cloneSet As DataSet = dataSet.Clone()

   ' Insert code to work with clone of the DataSet.
End Sub

Kommentarer

Note

Om dessa klasser har underklassats kommer klonen också att ha samma underklasser.

Gäller för

Se även