OleDbConnectionStringBuilder.OleDbServices プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > OleDbConnectionStringBuilder.OleDbServices プロパティの意味・解説 

OleDbConnectionStringBuilder.OleDbServices プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

接続文字列の中で OLE DB Services キー対応する値を取得または設定します

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

Dim instance As OleDbConnectionStringBuilder
Dim value As Integer

value = instance.OleDbServices

instance.OleDbServices = value
public int OleDbServices { get;
 set; }
public:
property int OleDbServices {
    int get ();
    void set (int value);
}
/** @property */
public int get_OleDbServices ()

/** @property */
public void set_OleDbServices (int
 value)
public function get OleDbServices
 () : int

public function set OleDbServices
 (value : int)

プロパティ
接続文字列の中で OLE DB Services キー対応する値を返します既定値は -13 です。

解説解説
使用例使用例

次の例では、OleDbServices プロパティを 2 とおりの方法操作してます。まず、このプロパティ直接値を設定する方法です。これが、生成される接続文字列どのような影響を及ぼすかを示します次に、OleDbConnectionStringBuilder をクリアし、OLE DB Services キーの値を含む完全な接続文字列設定する方法です。ここでは、接続文字列から値を設定しても、OleDbServices プロパティが変わることを示します

Imports System.Data.OleDb    

Module Module1
  ' These constants correspond to values in the 
  ' OLE DB SDK. You can use these values to 
  ' turn features on and off.
  Private Const DBPROPVAL_OS_AGR_AFTERSESSION
 As Integer = 8
  Private Const DBPROPVAL_OS_AGR_RESOURCEPOOLING
 As Integer = 1
  Private Const DBPROPVAL_OS_AGR_TXNENLISTMENT
 As Integer = 2
  Private Const DBPROPVAL_OS_AGR_CLIENTCURSOR
 As Integer = 4
  Private Const DBPROPVAL_OS_ENABLEALL As
 Integer = -1
  Private Const DBPROPVAL_OS_DISABLEALL As
 Integer = 0

  Sub Main()
    Dim builder As New OleDbConnectionStringBuilder()
    ' Turn on all services except resource pooling.
    builder.OleDbServices = DBPROPVAL_OS_ENABLEALL _
     And Not DBPROPVAL_OS_AGR_RESOURCEPOOLING

    builder.Provider = "sqloledb"
    builder.DataSource = "(local)"
    builder("Initial Catalog") = "AdventureWorks"
    builder("Integrated Security") = "SSPI"

    ' Store the connection string.
    Dim savedConnectionString As String
 = builder.ConnectionString
    Console.WriteLine(savedConnectionString)

    ' Reset the object. This resets all the properties to their
    ' default values.
    builder.Clear()

    ' Investigate the OleDbServices property before
    ' and after assigning a connection string value.
    Console.WriteLine("Default : " & builder.OleDbServices)
    builder.ConnectionString = savedConnectionString
    Console.WriteLine("Modified: " & builder.OleDbServices)

    Console.WriteLine("Press Enter to finish.")
    Console.ReadLine()
  End Sub
End Module
using System.Data.OleDb;

class Program
{
    // These constants correspond to values in the 
    // OLE DB SDK. You can use these values to 
    // turn features on and off.
    private const int DBPROPVAL_OS_AGR_AFTERSESSION
 = 8;
    private const int DBPROPVAL_OS_AGR_RESOURCEPOOLING
 = 1;
    private const int DBPROPVAL_OS_AGR_TXNENLISTMENT
 = 2;
    private const int DBPROPVAL_OS_AGR_CLIENTCURSOR
 = 4;
    private const int DBPROPVAL_OS_ENABLEALL
 = -1;
    private const int DBPROPVAL_OS_DISABLEALL
 = 0;


    static void Main()
    {
        OleDbConnectionStringBuilder builder =
            new OleDbConnectionStringBuilder();
        // Turn on all services except resource pooling.
        builder.OleDbServices =
            DBPROPVAL_OS_ENABLEALL &
            ~DBPROPVAL_OS_AGR_RESOURCEPOOLING;

        builder.Provider = "sqloledb";
        builder.DataSource = "(local)";
        builder["Initial Catalog"] = "AdventureWorks";
        builder["Integrated Security"] = "SSPI";

        // Store the connection string.
        string savedConnectionString = builder.ConnectionString;
        Console.WriteLine(savedConnectionString);

        // Reset the object. This resets all the properties to their
        // default values.
        builder.Clear();

        // Investigate the OleDbServices property before
        // and after assigning a connection string value.
        Console.WriteLine("Default : " + builder.OleDbServices);
        builder.ConnectionString = savedConnectionString;
        Console.WriteLine("Modified: " + builder.OleDbServices);

        Console.WriteLine("Press Enter to finish.");
        Console.ReadLine();
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
OleDbConnectionStringBuilder クラス
OleDbConnectionStringBuilder メンバ
System.Data.OleDb 名前空間
その他の技術情報
Building Connection Strings
接続文字列使用



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

辞書ショートカット

すべての辞書の索引

OleDbConnectionStringBuilder.OleDbServices プロパティのお隣キーワード
検索ランキング

   

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



OleDbConnectionStringBuilder.OleDbServices プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS