SPListItem.CopyFrom method (String, Hashtable, Byte[])

Overwrites the current item with the specified version of the item and its properties as a stream.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Sub CopyFrom ( _
    sourceUrl As String, _
    properties As Hashtable, _
    stream As Byte() _
)
'Usage
Dim instance As SPListItem
Dim sourceUrl As String
Dim properties As Hashtable
Dim stream As Byte()

instance.CopyFrom(sourceUrl, properties, _
    stream)
public void CopyFrom(
    string sourceUrl,
    Hashtable properties,
    byte[] stream
)

Parameters

  • sourceUrl
    Type: System.String

    The URL of the item version to copy.

    Note

    The source URL must reside on the same server on which the code is running. This copy operation does not copy from URLs on remote servers.

  • stream
    Type: []

    The copied item as a binary stream.

Exceptions

Exception Condition
ArgumentException

sourceUrl is null or empty.

-or-

properties or stream is null .

NotSupportedException

The SPListItem object has an external data source.

Remarks

This method overwrites the current list item with the item located at the sourceUrl and its properties specified by the properties parameter as a stream.

The CopyFrom method resets the CopySource property on the destination item to the value of the sourceUrl parameter.

See also

Reference

SPListItem class

SPListItem members

CopyFrom overload

Microsoft.SharePoint namespace