OracleConnectionStringBuilder.Keys OracleConnectionStringBuilder.Keys OracleConnectionStringBuilder.Keys OracleConnectionStringBuilder.Keys Property

定義

ICollection 内のキーが格納されている OracleConnectionStringBuilder を取得します。Gets an ICollection that contains the keys in the 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

プロパティ値

次に示すコンソール アプリケーション例では、新しい OracleConnectionStringBuilder を作成します。The following console application example creates a new OracleConnectionStringBuilder. このコードでは、ICollection プロパティによって返される Keys をループ処理して、キー/値ペアを表示します。The code loops through the ICollection returned by the Keys property displaying the key/value pairs.

// 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

注釈

ICollection 内の値の順序は指定されていませんが、ICollection プロパティによって返される Values 内の関連する値と同じ順序です。The order of the values in the ICollection is unspecified, but it is the same order as the associated values in the ICollection returned by the Values property.

適用対象

こちらもご覧ください