OdbcConnectionStringBuilder.Clear メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > OdbcConnectionStringBuilder.Clear メソッドの意味・解説 

OdbcConnectionStringBuilder.Clear メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

OdbcConnectionStringBuilder インスタンス内容消去します。

名前空間: System.Data.Odbc
アセンブリ: System.Data (system.data.dll 内)
構文構文

解説解説
使用例使用例
Imports System.Data.Odbc    

Module Module1
  Sub Main()
    Dim builder As New OdbcConnectionStringBuilder()

    ' Call the Add method to explicitly add key/value
    ' pairs to the internal collection.
    builder.Driver = "Microsoft Excel Driver (*.xls)"
    builder("Dbq") = "C:\Data.xls"
    builder("DriverID") = "790"
    builder("DefaultDir") = "C:\"

    ' Dump the contents of the "filled-in" OdbcConnectionStringBuilder
    ' to the console window.
    DumpBuilderContents(builder)

    ' Clear current values and reset known keys to their
    ' default values.
    builder.Clear()

    ' Dump the contents of the newly emptied 
    ' OdbcConnectionStringBuilder
    ' to the console window.
    DumpBuilderContents(builder)

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

  Private Sub DumpBuilderContents(ByVal
 builder As OdbcConnectionStringBuilder)
    Console.WriteLine("=================")
    Console.WriteLine("builder.ConnectionString = "
 & builder.ConnectionString)
    For Each key As String
 In builder.Keys
      Console.WriteLine(key & "=" & builder.Item(key).ToString)
    Next
  End Sub
End Module
using System.Data.Odbc;
class Program
{
    static void Main()
    {
        OdbcConnectionStringBuilder builder = new OdbcConnectionStringBuilder();

        // Call the Add method to explicitly add key/value
        // pairs to the internal collection.
        builder.Driver = "Microsoft Excel Driver (*.xls)";
        builder["Dbq"] = "C:\\Data.xls";
        builder["DriverID"] = "790";
        builder["DefaultDir"] = "C:\\";

        // Dump the contents of the "filled-in" OdbcConnectionStringBuilder
        // to the Console window:
        DumpBuilderContents(builder);

        // Clear current values and reset known keys to their
        // default values.
        builder.Clear();

        // Dump the contents of the newly emptied OdbcConnectionStringBuilder
        // to the console window.
        DumpBuilderContents(builder);

        Console.WriteLine("Press Enter to continue.");
        Console.ReadLine();
    }

    private static void
 DumpBuilderContents(OdbcConnectionStringBuilder builder)
    {
        Console.WriteLine("=================");
        Console.WriteLine("builder.ConnectionString = " + builder.ConnectionString);
        foreach (string key in
 builder.Keys)
        {
            Console.WriteLine(key + "=" + builder[key].ToString());
        }
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
OdbcConnectionStringBuilder クラス
OdbcConnectionStringBuilder メンバ
System.Data.Odbc 名前空間
その他の技術情報
Building Connection Strings
接続文字列使用



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

OdbcConnectionStringBuilder.Clear メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



OdbcConnectionStringBuilder.Clear メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS