Compartir a través de


AsymmetricKeys Propiedad

Representa una colección de objetos AsymmetricKey. Cada objeto AsymmetricKey representa una clave asimétrica definida en la base de datos.

Espacio de nombres:  Microsoft.SqlServer.Management.Smo
Ensamblado:  Microsoft.SqlServer.Smo (en Microsoft.SqlServer.Smo.dll)

Sintaxis

'Declaración
<SfcObjectAttribute(SfcContainerRelationship.ObjectContainer, SfcContainerCardinality.ZeroToAny,  _
    GetType(AsymmetricKey))> _
Public ReadOnly Property AsymmetricKeys As AsymmetricKeyCollection
    Get
'Uso
Dim instance As Database
Dim value As AsymmetricKeyCollection

value = instance.AsymmetricKeys
[SfcObjectAttribute(SfcContainerRelationship.ObjectContainer, SfcContainerCardinality.ZeroToAny, 
    typeof(AsymmetricKey))]
public AsymmetricKeyCollection AsymmetricKeys { get; }
[SfcObjectAttribute(SfcContainerRelationship::ObjectContainer, SfcContainerCardinality::ZeroToAny, 
    typeof(AsymmetricKey))]
public:
property AsymmetricKeyCollection^ AsymmetricKeys {
    AsymmetricKeyCollection^ get ();
}
[<SfcObjectAttribute(SfcContainerRelationship.ObjectContainer, SfcContainerCardinality.ZeroToAny, 
    typeof(AsymmetricKey))>]
member AsymmetricKeys : AsymmetricKeyCollection
function get AsymmetricKeys () : AsymmetricKeyCollection

Valor de la propiedad

Tipo: Microsoft.SqlServer.Management.Smo. . :: . .AsymmetricKeyCollection
Objeto AsymmetricKeyCollection que representa todas las claves asimétricas definidas en la base de datos.

Comentarios

Specific asymmetric keys can be referenced by using this collection by specifying the name of the asymmetric key. To add a new asymmetric key to the collection, call the asymmetric key constructor AsymmetricKey.

Ejemplos

VB

'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server

'Reference the AdventureWorks2008R2 database.
Dim db As Database
db = srv.Databases("AdventureWorks2008R2")

'Display all the asymmetric keys on the database.
Dim ak As AsymmetricKey
For Each ak In db.AsymmetricKeys
   Console.WriteLine(ak.Name)
Next

PowerShell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$db = New-Object Microsoft.SqlServer.Management.Smo.Database
$db = $srv.Databases.Item("AdventureWorks2008R2")
foreach ($ak in $db.AsymmetricKeys)
{
   Write-Host $ak.Name
}