Compartir a través de


RoleDefinitionCollection.GetByName Method

Returns Role specified by name.

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 Function GetByName ( _
    name As String _
) As RoleDefinition
'Usage
Dim instance As RoleDefinitionCollection
Dim name As String
Dim returnValue As RoleDefinition

returnValue = instance.GetByName(name)
[RemoteAttribute]
public RoleDefinition GetByName(
    string name
)

Parameters

Return Value

Type: Microsoft.SharePoint.Client.RoleDefinition
Returns a RoleDefinition instance representing name of Role.

Exceptions

Exception Condition
[Microsoft.SharePoint.SPException]

Cannot find Role by this name. Error code: -2146232832.

[Microsoft.SharePoint.SPException]

Name must not be empty or bigger than 255 characters. Error code: -2146232832.

Remarks

It must not be a null reference (Nothing in Visual Basic). It must not be empty. Its length must be equal to or less than 255. Trimmed name must not be empty.

See Also

Reference

RoleDefinitionCollection Class

RoleDefinitionCollection Members

Microsoft.SharePoint.Client Namespace