FileVersionCollection.RestoreByLabel Method

Creates a new file version from the file specified by the version label.

Namespace:  Microsoft.SharePoint.Client
Assemblies:   Microsoft.SharePoint.Client.Silverlight (in Microsoft.SharePoint.Client.Silverlight.dll);  Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)

Syntax

'Declaration
<RemoteAttribute> _
Public Sub RestoreByLabel ( _
    versionlabel As String _
)
'Usage
Dim instance As FileVersionCollection
Dim versionlabel As String

instance.RestoreByLabel(versionlabel)
[RemoteAttribute]
public void RestoreByLabel(
    string versionlabel
)

Parameters

  • versionlabel
    Type: System.String

    Specifies the version label.

    It must not be a null reference (Nothing in Visual Basic). It must not be empty. Version label must be the return value from VersionLabel property of a Microsoft.Sharepoint.Client.FileVersion object.

Exceptions

Exception Condition
[Microsoft.SharePoint.SPException]

File is checked out by a user other than the current user. Error code: - 2130575306.

[Microsoft.SharePoint.SPException]

Operation is not valid for the current state of the object. Operation is prohibited; the published version is greater than the attempted restore version. Error code: -2130246262.

[Microsoft.SharePoint.SPQueryThrottledException]

List view threshold was exceeded. Error code: -2147024860.

[Microsoft.SharePoint.SPQueryThrottledException]

Lack of system resources available to process this command. Error code: -2147024749.

[System.ArgumentException]

Version label property of the Microsoft.Sharepoint.Client.FileVersion object is invalid. Error code: -2147024809.

[System.IO.DirectoryNotFoundException]

Specified version label is invalid. Error code: -2147024893.

[System.UnauthorizedAccessException]

The current user has insufficient permissions. Error code: -2147024891.

See Also

Reference

FileVersionCollection Class

FileVersionCollection Members

Microsoft.SharePoint.Client Namespace