Partilhar via


Método SqlHierarchyId.ToString

Returns the canonical string representation of a SqlHierarchyId node from a SqlHierarchyId value.

Namespace:  Microsoft.SqlServer.Types
Assembly:  Microsoft.SqlServer.Types (em Microsoft.SqlServer.Types.dll)

Sintaxe

'Declaração
<SqlMethodAttribute(DataAccess := DataAccessKind.None, SystemDataAccess := SystemDataAccessKind.None,  _
    InvokeIfReceiverIsNull := False, OnNullCall := False,  _
    IsDeterministic := True, IsPrecise := True, IsMutator := False)> _
Public Overrides Function ToString As String
'Uso
Dim instance As SqlHierarchyId 
Dim returnValue As String 

returnValue = instance.ToString()
[SqlMethodAttribute(DataAccess = DataAccessKind.None, SystemDataAccess = SystemDataAccessKind.None, 
    InvokeIfReceiverIsNull = false, OnNullCall = false, 
    IsDeterministic = true, IsPrecise = true, IsMutator = false)]
public override string ToString()
[SqlMethodAttribute(DataAccess = DataAccessKind::None, SystemDataAccess = SystemDataAccessKind::None, 
    InvokeIfReceiverIsNull = false, OnNullCall = false, 
    IsDeterministic = true, IsPrecise = true, IsMutator = false)]
public:
virtual String^ ToString() override
[<SqlMethodAttribute(DataAccess = DataAccessKind.None, SystemDataAccess = SystemDataAccessKind.None, 
    InvokeIfReceiverIsNull = false, OnNullCall = false, 
    IsDeterministic = true, IsPrecise = true, IsMutator = false)>]
abstract ToString : unit -> string 
[<SqlMethodAttribute(DataAccess = DataAccessKind.None, SystemDataAccess = SystemDataAccessKind.None, 
    InvokeIfReceiverIsNull = false, OnNullCall = false, 
    IsDeterministic = true, IsPrecise = true, IsMutator = false)>]
override ToString : unit -> string
public override function ToString() : String

Valor de retorno

Tipo: System.String
String

Comentários

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

Acts as the opposite of Parse.

Exemplos

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

Consulte também

Referência

SqlHierarchyId Estrutura

Namespace Microsoft.SqlServer.Types