共用方式為


SqlHierarchyId.Parse 方法

Converts the canonical string representation of a SqlHierarchyId node to a SqlHierarchyId value.

命名空間:  Microsoft.SqlServer.Types
組件:  Microsoft.SqlServer.Types (在 Microsoft.SqlServer.Types.dll 中)

語法

'宣告
<SqlMethodAttribute(DataAccess := DataAccessKind.None, SystemDataAccess := SystemDataAccessKind.None,  _
    InvokeIfReceiverIsNull := False, OnNullCall := False,  _
    IsDeterministic := True, IsPrecise := True, IsMutator := False)> _
Public Shared Function Parse ( _
    input As SqlString _
) As SqlHierarchyId
'用途
Dim input As SqlString 
Dim returnValue As SqlHierarchyId 

returnValue = SqlHierarchyId.Parse(input)
[SqlMethodAttribute(DataAccess = DataAccessKind.None, SystemDataAccess = SystemDataAccessKind.None, 
    InvokeIfReceiverIsNull = false, OnNullCall = false, 
    IsDeterministic = true, IsPrecise = true, IsMutator = false)]
public static SqlHierarchyId Parse(
    SqlString input
)
[SqlMethodAttribute(DataAccess = DataAccessKind::None, SystemDataAccess = SystemDataAccessKind::None, 
    InvokeIfReceiverIsNull = false, OnNullCall = false, 
    IsDeterministic = true, IsPrecise = true, IsMutator = false)]
public:
static SqlHierarchyId Parse(
    SqlString input
)
[<SqlMethodAttribute(DataAccess = DataAccessKind.None, SystemDataAccess = SystemDataAccessKind.None, 
    InvokeIfReceiverIsNull = false, OnNullCall = false, 
    IsDeterministic = true, IsPrecise = true, IsMutator = false)>]
static member Parse : 
        input:SqlString -> SqlHierarchyId
public static function Parse(
    input : SqlString
) : SqlHierarchyId

參數

傳回值

型別:Microsoft.SqlServer.Types.SqlHierarchyId
SqlHierarchyId representing the node described canonically.

備註

Called implicitly when a conversion from a string type to SqlHierarchyId data type occurs.

Acts as the opposite of ToString.

An exception is raised if Parsereceives a value that is not a valid string representation of a SqlHierarchyId.

This member is static.

範例

DECLARE @StringValue AS nvarchar(4000), @hierarchyidValue AS hierarchyid
SET @StringValue = '/1/1/3/'
SET @hierarchyidValue = 0x5ADE

SELECT hierarchyid::Parse(@StringValue) AS hierarchyidRepresentation,
 @hierarchyidValue.ToString() AS StringRepresentation ;
GO

請參閱

參考

SqlHierarchyId 結構

Microsoft.SqlServer.Types 命名空間