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

Copies the specified item and its properties as a stream to the specified destination.

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

Syntax

'Declaration
Public Shared Sub Copy ( _
    sourceUrl As String, _
    destinationUrl As String, _
    properties As Hashtable, _
    stream As Byte() _
)
'Usage
Dim sourceUrl As String
Dim destinationUrl As String
Dim properties As Hashtable
Dim stream As Byte()

SPListItem.Copy(sourceUrl, destinationUrl, _
    properties, stream)
public static void Copy(
    string sourceUrl,
    string destinationUrl,
    Hashtable properties,
    byte[] stream
)

Parameters

  • sourceUrl
    Type: System.String

    The URL of the source location of the item to copy, which is used to set the CopySource field of the copied item.

  • destinationUrl
    Type: System.String

    The destination URL of the item.

    Note

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

  • stream
    Type: []

    The item as a binary stream.

Exceptions

Exception Condition
ArgumentException

sourceUrl or the destinationUrl is null or empty.

-or-

properties or stream is null .

Remarks

This method copies the list item located at the sourceUrl and its properties specified by the properties parameter as a stream to the destination location specified by the destinationUrl parameter.

See also

Reference

SPListItem class

SPListItem members

Copy overload

Microsoft.SharePoint namespace