SPUtility.ObjectToGuid Method

Converts an object to a Guid structure.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

public static Guid ObjectToGuid(
	Object o


Type: System.Object

The object to convert.

Return Value

Type: System.Guid
If the type of the object is GUID, string, or byte[], the method returns a valid Guid. Otherwise, it returns GUID.Empty.