SqlHierarchyId.GetAncestor 메서드

Retrieves the SqlHierarchyId node n levels up the hierarchical tree.

네임스페이스:  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 Function GetAncestor ( _
    n As Integer _
) As SqlHierarchyId
‘사용 방법
Dim instance As SqlHierarchyId 
Dim n As Integer 
Dim returnValue As SqlHierarchyId 

returnValue = instance.GetAncestor(n)
[SqlMethodAttribute(DataAccess = DataAccessKind.None, SystemDataAccess = SystemDataAccessKind.None, 
    InvokeIfReceiverIsNull = false, OnNullCall = false, 
    IsDeterministic = true, IsPrecise = true, IsMutator = false)]
public SqlHierarchyId GetAncestor(
    int n
)
[SqlMethodAttribute(DataAccess = DataAccessKind::None, SystemDataAccess = SystemDataAccessKind::None, 
    InvokeIfReceiverIsNull = false, OnNullCall = false, 
    IsDeterministic = true, IsPrecise = true, IsMutator = false)]
public:
SqlHierarchyId GetAncestor(
    int n
)
[<SqlMethodAttribute(DataAccess = DataAccessKind.None, SystemDataAccess = SystemDataAccessKind.None, 
    InvokeIfReceiverIsNull = false, OnNullCall = false, 
    IsDeterministic = true, IsPrecise = true, IsMutator = false)>]
member GetAncestor : 
        n:int -> SqlHierarchyId
public function GetAncestor(
    n : int
) : SqlHierarchyId

매개 변수

  • n
    유형: System.Int32
    An integer representing the number of levels to ascend in the hierarchy.

반환 값

유형: Microsoft.SqlServer.Types.SqlHierarchyId
SqlHierarchyId representing the nth ancestor of this.If a number greater than GetLevel is passed, nullnull 참조(Visual Basic에서는 Nothing) is returned.If a negative number is passed, an exception is raised indicating that the argument is out of range.

참고 항목

참조

SqlHierarchyId 구조

Microsoft.SqlServer.Types 네임스페이스