SPList.GetDistinctFieldValues Method
NOTE: This API is now obsolete.
Returns a two-dimensional object that represents an array of field values in which data duplication within a specified field in the list is eliminated and each value returned is unique.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Syntax
'Declaration
<ObsoleteAttribute("Use SPList.GetItems(SPQuery) instead.")> _
Public Function GetDistinctFieldValues ( _
field As SPField, _
<OutAttribute> ByRef columnItems As Object(,) _
) As UInteger
'Usage
Dim instance As SPList
Dim field As SPField
Dim columnItems As Object(,)
Dim returnValue As UInteger
returnValue = instance.GetDistinctFieldValues(field, _
columnItems)
[ObsoleteAttribute("Use SPList.GetItems(SPQuery) instead.")]
public uint GetDistinctFieldValues(
SPField field,
out Object[,] columnItems
)
Parameters
field
Type: Microsoft.SharePoint.SPFieldA SPField object that represents the field from which the duplicates are to be removed.
columnItems
Type: [,]A two-dimensional object array that is passed as an out parameter and that returns the values.
Return Value
Type: System.UInt32
Returns an UInt32 An unsigned 32-bit integer that specifies the number of field values represented in the array.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Field is null. |
Exception | Cannot get distinct values. Type is not Text, Number, Currency, DateTime, or Boolean. |