OracleConnectionStringBuilder.Keys Proprietà

Definizione

Ottiene un oggetto ICollection che contiene le chiavi presenti in OracleConnectionStringBuilder.

public:
 virtual property System::Collections::ICollection ^ Keys { System::Collections::ICollection ^ get(); };
public override System.Collections.ICollection Keys { get; }
member this.Keys : System.Collections.ICollection
Public Overrides ReadOnly Property Keys As ICollection

Valore della proprietà

Oggetto ICollection che contiene le chiavi presenti in OracleConnectionStringBuilder.

Esempio

Nell'esempio dell'applicazione console seguente viene creato un oggetto OracleConnectionStringBuilder. Il codice esegue un ciclo tramite l'oggetto ICollection restituito dalla proprietà Keys che visualizza le coppie chiave/valore.

// You may need to set a reference to the System.Data.OracleClient
// assembly before running this example.
using System.Data.OracleClient;

class Program
{
    static void Main()
    {
        OracleConnectionStringBuilder builder =
            new OracleConnectionStringBuilder();
        builder.DataSource = "OracleSample";
        builder.IntegratedSecurity = true;

        // Loop through the collection of keys, displaying
        // the key and value for each item.
        foreach (string key in builder.Keys)
            Console.WriteLine("{0}={1}", key, builder[key]);

        Console.WriteLine();
        Console.WriteLine("Press Enter to continue.");
        Console.ReadLine();
    }
}
' You may have to set a reference to the System.Data.OracleClient
' assembly before running this example.
Imports System.Data.OracleClient

Module Module1
  Sub Main()
    Dim builder As New OracleConnectionStringBuilder
    builder.DataSource = "OracleSample"
    builder.IntegratedSecurity = True

    ' Loop through the collection of keys, displaying 
    ' the key and value for each item.
    For Each key As String In builder.Keys
      Console.WriteLine("{0}={1}", key, builder(key))
    Next

    Console.WriteLine()
    Console.WriteLine("Press Enter to continue.")
    Console.ReadLine()
  End Sub
End Module

Commenti

L'ordine dei valori in ICollection non è specificato, ma è lo stesso ordine dei valori associati nell'oggetto ICollection restituito dalla proprietà Values.

Si applica a

Vedi anche