SqlConnectionStringBuilder 類別

定義

提供簡單的方法,以建立和管理 SqlConnection 類別使用之連接字串的內容。Provides a simple way to create and manage the contents of connection strings used by the SqlConnection class.

public ref class SqlConnectionStringBuilder sealed : System::Data::Common::DbConnectionStringBuilder
public sealed class SqlConnectionStringBuilder : System.Data.Common.DbConnectionStringBuilder
[System.ComponentModel.TypeConverter(typeof(System.Data.SqlClient.SqlConnectionStringBuilder/SqlConnectionStringBuilderConverter))]
public sealed class SqlConnectionStringBuilder : System.Data.Common.DbConnectionStringBuilder
type SqlConnectionStringBuilder = class
    inherit DbConnectionStringBuilder
Public NotInheritable Class SqlConnectionStringBuilder
Inherits DbConnectionStringBuilder
繼承
SqlConnectionStringBuilder
屬性

範例

下列主控台應用程式會建立 SQL Server 資料庫的連接字串。The following console application builds connection strings for a SQL Server database. 此程式碼會使用 SqlConnectionStringBuilder 類別建立連接字串,然後將 ConnectionString 執行個體的 SqlConnectionStringBuilder 屬性傳遞給連接類別的建構函式。The code uses a SqlConnectionStringBuilder class to create the connection string, and then passes the ConnectionString property of the SqlConnectionStringBuilder instance to the constructor of the connection class. 此範例也會剖析現有的連接字串,並示範操作連接字串內容的各種方式。The example also parses an existing connection string and demonstrates various ways of manipulating the connection string's contents.

注意

這個範例包含了密碼,可示範 SqlConnectionStringBuilder 如何搭配連接字串使用。This example includes a password to demonstrate how SqlConnectionStringBuilder works with connection strings. 我們建議在您的應用程式中使用 Windows 驗證。In your applications, we recommend that you use Windows Authentication. 如果您必須使用密碼,請勿在您的應用程式中包含硬式編碼的密碼。If you must use a password, do not include a hard-coded password in your application.

using System.Data;
using System.Data.SqlClient;

class Program
{
    static void Main()
    {
        // Create a new SqlConnectionStringBuilder and
        // initialize it with a few name/value pairs.
        SqlConnectionStringBuilder builder =
            new SqlConnectionStringBuilder(GetConnectionString());

        // The input connection string used the
        // Server key, but the new connection string uses
        // the well-known Data Source key instead.
        Console.WriteLine(builder.ConnectionString);

        // Pass the SqlConnectionStringBuilder an existing
        // connection string, and you can retrieve and
        // modify any of the elements.
        builder.ConnectionString = "server=(local);user id=ab;" +
            "password= a!Pass113;initial catalog=AdventureWorks";

        // Now that the connection string has been parsed,
        // you can work with individual items.
        Console.WriteLine(builder.Password);
        builder.Password = "new@1Password";
        builder.AsynchronousProcessing = true;

        // You can refer to connection keys using strings,
        // as well. When you use this technique (the default
        // Item property in Visual Basic, or the indexer in C#),
        // you can specify any synonym for the connection string key
        // name.
        builder["Server"] = ".";
        builder["Connect Timeout"] = 1000;
        builder["Trusted_Connection"] = true;
        Console.WriteLine(builder.ConnectionString);

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

    private static string GetConnectionString()
    {
        // To avoid storing the connection string in your code,
        // you can retrieve it from a configuration file.
        return "Server=(local);Integrated Security=SSPI;" +
            "Initial Catalog=AdventureWorks";
    }
}
Imports System.Data.SqlClient

Module Module1
    Sub Main()
        ' Create a new SqlConnectionStringBuilder and
        ' initialize it with a few name/value pairs:
        Dim builder As New SqlConnectionStringBuilder(GetConnectionString())

        ' The input connection string used the 
        ' Server key, but the new connection string uses
        ' the well-known Data Source key instead.
        Console.WriteLine(builder.ConnectionString)

        ' Pass the SqlConnectionStringBuilder an existing 
        ' connection string, and you can retrieve and
        ' modify any of the elements.
        builder.ConnectionString = _
            "server=(local);user id=ab;" & _
            "password=a!Pass113;initial catalog=AdventureWorks"
        ' Now that the connection string has been parsed,
        ' you can work with individual items.
        Console.WriteLine(builder.Password)
        builder.Password = "new@1Password"
        builder.AsynchronousProcessing = True

        ' You can refer to connection keys using strings, 
        ' as well. When you use this technique (the default
        ' Item property in Visual Basic, or the indexer in C#)
        ' you can specify any synonym for the connection string key
        ' name.
        builder("Server") = "."
        builder("Connect Timeout") = 1000

        ' The Item property is the default for the class, 
        ' and setting the Item property adds the value to the 
        ' dictionary, if necessary. 
        builder.Item("Trusted_Connection") = True
        Console.WriteLine(builder.ConnectionString)

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

    Private Function GetConnectionString() As String
        ' To avoid storing the connection string in your code,
        ' you can retrieve it from a configuration file. 
        Return "Server=(local);Integrated Security=SSPI;" & _
          "Initial Catalog=AdventureWorks"
    End Function
End Module

備註

連接字串產生器 (Builder) 可讓開發人員使用類別的屬性和方法,以程式設計方式建立語法正確的連接字串,以及剖析和重建現有的連接字串。The connection string builder lets developers programmatically create syntactically correct connection strings, and parse and rebuild existing connection strings, using properties and methods of the class. 連接字串產生器提供強型別 (Strongly Typed) 屬性,這些屬性對應到 SQL Server 允許的已知索引鍵/值組。The connection string builder provides strongly typed properties corresponding to the known key/value pairs allowed by SQL Server. 必須建立連接字串做為應用程式一部分的開發人員可以使用 SqlConnectionStringBuilder 類別來建置及修改連接字串。Developers needing to create connection strings as part of applications can use the SqlConnectionStringBuilder class to build and modify connection strings. 此類別也可讓您輕鬆管理儲存在應用程式組態檔內的連接字串。The class also makes it easy to manage connection strings stored in an application configuration file.

SqlConnectionStringBuilder 會執行有效索引鍵/值組的檢查。The SqlConnectionStringBuilder performs checks for valid key/value pairs. 因此,您無法使用這個類別來建立無效的連接字串,嘗試加入無效的索引鍵/值組將會擲回例外狀況。Therefore, you cannot use this class to create invalid connection strings; trying to add invalid pairs will throw an exception. 此類別會維護固定的同義資料表 (Synonym) 集合,且可從同義資料表轉譯為相對應的已知索引鍵名稱。The class maintains a fixed collection of synonyms and can translate from a synonym to the corresponding well-known key name.

例如,當您使用Item屬性來抓取值時,您可以指定字串,其中包含所需索引鍵的任何同義字。For example, when you use the Item property to retrieve a value, you can specify a string that contains any synonym for the key you need. 例如,當您使用的任何成員需要包含索引鍵名稱的字串(例如Item屬性或 Remove 方法)時,您可以為連接字串內的這個索引鍵指定 "Network Address"、"addr" 或其他任何可接受的同義字。For example, you can specify "Network Address", "addr", or any other acceptable synonym for this key within a connection string when you use any member that requires a string that contains the key name, such as the Item property or the Remove method. 如需可接受的完整同義資料表清單,請參閱 ConnectionString 屬性。See the ConnectionString property for a full list of acceptable synonyms.

Item屬性會處理嘗試插入惡意專案的工作。The Item property handles tries to insert malicious entries. 例如,使用預設 Item 屬性 (C# 中則為索引子) 的下列程式碼會正確逸出巢狀索引鍵/值組:For example, the following code, using the default Item property (the indexer, in C#) correctly escapes the nested key/value pair:

Dim builder As New System.Data.SqlClient.SqlConnectionStringBuilder
builder("Data Source") = "(local)"
builder("Integrated Security") = True
builder("Initial Catalog") = "AdventureWorks;NewValue=Bad"
Console.WriteLine(builder.ConnectionString)
System.Data.SqlClient.SqlConnectionStringBuilder builder =
  new System.Data.SqlClient.SqlConnectionStringBuilder();
builder["Data Source"] = "(local)";
builder["integrated Security"] = true;
builder["Initial Catalog"] = "AdventureWorks;NewValue=Bad";
Console.WriteLine(builder.ConnectionString);

結果是以安全方式處理無效值的下列連接字串:The result is the following connection string that handles the invalid value in a safe manner:

Source=(local);Initial Catalog="AdventureWorks;NewValue=Bad";
Integrated Security=True

建構函式

SqlConnectionStringBuilder()

初始化 SqlConnectionStringBuilder 類別的新執行個體。Initializes a new instance of the SqlConnectionStringBuilder class.

SqlConnectionStringBuilder(String)

初始化 SqlConnectionStringBuilder 類別的新執行個體。Initializes a new instance of the SqlConnectionStringBuilder class. 所提供的連接字串會提供執行個體內部連接資訊的資料。The provided connection string provides the data for the instance's internal connection information.

屬性

ApplicationIntent

當連接到 SQL Server 可用性群組中的資料庫時,宣告應用程式工作負載類型。Declares the application workload type when connecting to a database in an SQL Server Availability Group. 您可以使用 ApplicationIntent 來設定這個屬性的值。You can set the value of this property with ApplicationIntent. 如需 AlwaysOn 可用性群組的 SqlClient 支援詳細資訊,請參閱高可用性、災害復原的 SqlClient 支援For more information about SqlClient support for Always On Availability Groups, see SqlClient Support for High Availability, Disaster Recovery.

ApplicationName

取得或設定與連接字串相關聯的應用程式名稱。Gets or sets the name of the application associated with the connection string.

AsynchronousProcessing

取得或設定布林值,指出使用這個連接字串建立的連接是否允許非同步處理 (Asynchronous Processing)。Gets or sets a Boolean value that indicates whether asynchronous processing is allowed by the connection created by using this connection string.

AttachDBFilename

取得或設定包含主要資料檔名稱的字串。Gets or sets a string that contains the name of the primary data file. 這包括可附加之資料庫的完整路徑名稱。This includes the full path name of an attachable database.

Authentication

取得連接字串的驗證。Gets the authentication of the connection string.

BrowsableConnectionString

取得或設定值,指出 ConnectionString 屬性是否會顯示在 Visual Studio 設計工具中。Gets or sets a value that indicates whether the ConnectionString property is visible in Visual Studio designers.

(繼承來源 DbConnectionStringBuilder)
ColumnEncryptionSetting

取得或設定連接字串產生器的資料行加密設定。Gets or sets the column encryption settings for the connection string builder.

ConnectionReset

已經過時:Obsolete. 取得或設定布林值,指出從連接集區提取時是否重設連接。Gets or sets a Boolean value that indicates whether the connection is reset when drawn from the connection pool.

ConnectionString

取得或設定與 DbConnectionStringBuilder 相關聯的連接字串。Gets or sets the connection string associated with the DbConnectionStringBuilder.

(繼承來源 DbConnectionStringBuilder)
ConnectRetryCount

在識別出閒置連線失敗後,已嘗試的重新連線次數。The number of reconnections attempted after identifying that there was an idle connection failure. 此值必須是介於 0 到 255 之間的整數。This must be an integer between 0 and 255. 預設值為 1。Default is 1. 設定為 0 以停用閒置連線失敗的重新連線。Set to 0 to disable reconnecting on idle connection failures. 如果設為超出允許範圍的值,就會擲回 ArgumentExceptionAn ArgumentException will be thrown if set to a value outside of the allowed range.

ConnectRetryInterval

在識別出閒置連線的失敗之後,每個重新連線嘗試之間的時間量 (以秒為單位)。Amount of time (in seconds) between each reconnection attempt after identifying that there was an idle connection failure. 此值必須是介於 1 到 60 之間的整數。This must be an integer between 1 and 60. 預設值是 10 秒。The default is 10 seconds. 如果設為超出允許範圍的值,就會擲回 ArgumentExceptionAn ArgumentException will be thrown if set to a value outside of the allowed range.

ConnectTimeout

取得或設定在終止嘗試並產生錯誤之前,要等待伺服器連接的時間長度 (以秒為單位)。Gets or sets the length of time (in seconds) to wait for a connection to the server before terminating the attempt and generating an error.

ContextConnection

取得或設定值,指出是否應該與 SQL Server 進行用戶端/伺服器或同處理序 (In-Process) 連接。Gets or sets a value that indicates whether a client/server or in-process connection to SQL Server should be made.

Count

取得 ConnectionString 屬性內所包含的索引鍵目前數目。Gets the current number of keys that are contained within the ConnectionString property.

(繼承來源 DbConnectionStringBuilder)
CurrentLanguage

取得或設定 SQL Server Language 記錄名稱。Gets or sets the SQL Server Language record name.

DataSource

取得或設定要連接之 SQL Server 執行個體的名稱或網路位址。Gets or sets the name or network address of the instance of SQL Server to connect to.

EnclaveAttestationUrl

取得或設定飛地證明 URL 以搭配飛地一律加密使用。Gets or sets the enclave attestation Url to be used with enclave based Always Encrypted.

Encrypt

取得或設定布林值,指出如果伺服器已安裝憑證,SQL Server 是否會針對用戶端與伺服器之間傳送的所有資料使用 SSL 加密。Gets or sets a Boolean value that indicates whether SQL Server uses SSL encryption for all data sent between the client and server if the server has a certificate installed.

Enlist

取得或設定布林值,指出 SQL Server 連接共用器是否在建立執行緒的目前異動內容中,自動登記連接。Gets or sets a Boolean value that indicates whether the SQL Server connection pooler automatically enlists the connection in the creation thread's current transaction context.

FailoverPartner

取得或設定主要伺服器當機時,要連接之夥伴伺服器的名稱或位址。Gets or sets the name or address of the partner server to connect to if the primary server is down.

InitialCatalog

取得或設定與連接相關聯的資料庫名稱。Gets or sets the name of the database associated with the connection.

IntegratedSecurity

取得或設定布林值,指出是否在連接中指定使用者 ID 和密碼 (false 時) 或目前 Windows 帳戶認證是否用於驗證 (true 時)。Gets or sets a Boolean value that indicates whether User ID and Password are specified in the connection (when false) or whether the current Windows account credentials are used for authentication (when true).

IsFixedSize

取得值,指出 SqlConnectionStringBuilder 是否具有固定的大小。Gets a value that indicates whether the SqlConnectionStringBuilder has a fixed size.

IsReadOnly

取得值,指出 DbConnectionStringBuilder 是否唯讀。Gets a value that indicates whether the DbConnectionStringBuilder is read-only.

(繼承來源 DbConnectionStringBuilder)
Item[String]

取得或設定與指定之索引鍵相關聯的值。Gets or sets the value associated with the specified key. 在 C# 中,這個屬性是索引子 (Indexer)。In C#, this property is the indexer.

Keys

取得 ICollection 中包含索引鍵的 SqlConnectionStringBuilderGets an ICollection that contains the keys in the SqlConnectionStringBuilder.

LoadBalanceTimeout

取得或設定在遭到終結之前,連接在連接集區中存在的最短時間 (以秒為單位)。Gets or sets the minimum time, in seconds, for the connection to live in the connection pool before being destroyed.

MaxPoolSize

取得或設定連接集區中,針對這個特定的連接字串允許的最大連接數目。Gets or sets the maximum number of connections allowed in the connection pool for this specific connection string.

MinPoolSize

取得或設定連接集區中,針對這個特定的連接字串允許的最小連接數目。Gets or sets the minimum number of connections allowed in the connection pool for this specific connection string.

MultipleActiveResultSets

為 true 時,應用程式可以維護 Multiple Active Result Sets(MARS)。When true, an application can maintain multiple active result sets (MARS). 為 false 時,應用程式必須處理或取消一個批次處理的所有結果集,才能在該連接上執行任何其他批次處理。When false, an application must process or cancel all result sets from one batch before it can execute any other batch on that connection.

如需詳細資訊,請參閱 Multiple Active Result Sets (MARS)For more information, see Multiple Active Result Sets (MARS).

MultiSubnetFailover

如果您的應用程式在不同子網路上連接到 AlwaysOn 可用性群組 (AG),則設定 MultiSubnetFailover=true 能夠更快速地偵測目前使用中的伺服器並與其連接。If your application is connecting to an AlwaysOn availability group (AG) on different subnets, setting MultiSubnetFailover=true provides faster detection of and connection to the (currently) active server. 如需 AlwaysOn 可用性群組的 SqlClient 支援詳細資訊,請參閱高可用性、災害復原的 SqlClient 支援For more information about SqlClient support for Always On Availability Groups, see SqlClient Support for High Availability, Disaster Recovery.

NetworkLibrary

取得或設定字串,其中包含用於建立 SQL Server 連接的網路程式庫名稱。Gets or sets a string that contains the name of the network library used to establish a connection to the SQL Server.

PacketSize

取得或設定用於與 SQL Server 執行個體通訊的網路封包大小 (以位元組為單位)。Gets or sets the size in bytes of the network packets used to communicate with an instance of SQL Server.

Password

取得或設定 SQL Server 帳戶的密碼。Gets or sets the password for the SQL Server account.

PersistSecurityInfo

取得或設定布林值,指出連接開啟或曾經處於開啟狀態時,是否將敏感的安全性資訊 (如密碼) 當做連接的一部分傳回。Gets or sets a Boolean value that indicates if security-sensitive information, such as the password, is not returned as part of the connection if the connection is open or has ever been in an open state.

PoolBlockingPeriod

連接集區封鎖期間的行為。The blocking period behavior for a connection pool.

Pooling

取得或設定布林值,指出每次要求連接時,是要緩衝處理連接還是明確開啟連接。Gets or sets a Boolean value that indicates whether the connection will be pooled or explicitly opened every time that the connection is requested.

Replication

取得或設定布林值,指出使用連接是否支援複寫。Gets or sets a Boolean value that indicates whether replication is supported using the connection.

TransactionBinding

取得或設定字串值,表示連接如何維護與已登記之 System.Transactions 交易的關聯。Gets or sets a string value that indicates how the connection maintains its association with an enlisted System.Transactions transaction.

TransparentNetworkIPResolution

當此索引鍵的值設定為 true 時,應用程式必須擷取特定 DNS 項目的所有 IP 位址,並嘗試連線至清單上的第一個項目。When the value of this key is set to true, the application is required to retrieve all IP addresses for a particular DNS entry and attempt to connect with the first one in the list. 如果無法在 0.5 秒內建立連線,應用程式將會嘗試同時連線至所有其他項目。If the connection is not established within 0.5 seconds, the application will try to connect to all others in parallel. 在連線被接聽之後,應用程式便會與回應者的 IP 位址建立連線。When the first answers, the application will establish the connection with the respondent IP address.

TrustServerCertificate

取得或設定值,指出通道是否會加密,同時略過驗證信任的憑證鏈結查核。Gets or sets a value that indicates whether the channel will be encrypted while bypassing walking the certificate chain to validate trust.

TypeSystemVersion

取得或設定字串值,表示應用程式預期的型別系統。Gets or sets a string value that indicates the type system the application expects.

UserID

取得或設定連接至 SQL Server 時要使用的使用者 ID。Gets or sets the user ID to be used when connecting to SQL Server.

UserInstance

取得或設定值,指出是否將連接從預設 SQL Server Express 執行個體,重新導向在呼叫端帳戶下執行之執行階段啟始的執行個體。Gets or sets a value that indicates whether to redirect the connection from the default SQL Server Express instance to a runtime-initiated instance running under the account of the caller.

Values

取得包含 ICollection 中之值的 SqlConnectionStringBuilderGets an ICollection that contains the values in the SqlConnectionStringBuilder.

WorkstationID

取得或設定連接至 SQL Server 的工作站名稱。Gets or sets the name of the workstation connecting to SQL Server.

方法

Add(String, Object)

將有指定索引鍵和數值項目加入 DbConnectionStringBuilder 中。Adds an entry with the specified key and value into the DbConnectionStringBuilder.

(繼承來源 DbConnectionStringBuilder)
Clear()

清除 SqlConnectionStringBuilder 執行個體的內容。Clears the contents of the SqlConnectionStringBuilder instance.

ClearPropertyDescriptors()

清除在相關聯 PropertyDescriptor 上的 DbConnectionStringBuilder 物件集合。Clears the collection of PropertyDescriptor objects on the associated DbConnectionStringBuilder.

(繼承來源 DbConnectionStringBuilder)
ContainsKey(String)

判斷 SqlConnectionStringBuilder 是否包含特定索引鍵。Determines whether the SqlConnectionStringBuilder contains a specific key.

Equals(Object)

Determines whether the specified object is equal to the current object.Determines whether the specified object is equal to the current object.

(繼承來源 Object)
EquivalentTo(DbConnectionStringBuilder)

比較在這個 DbConnectionStringBuilder 物件中的連接資訊和提供之物件中的連接資訊。Compares the connection information in this DbConnectionStringBuilder object with the connection information in the supplied object.

(繼承來源 DbConnectionStringBuilder)
GetHashCode()

Serves as the default hash function.Serves as the default hash function.

(繼承來源 Object)
GetProperties(Hashtable)

以這個 Hashtable 之所有屬性的相關資訊填滿提供的 DbConnectionStringBuilderFills a supplied Hashtable with information about all the properties of this DbConnectionStringBuilder.

(繼承來源 DbConnectionStringBuilder)
GetType()

Gets the Type of the current instance.Gets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

Creates a shallow copy of the current Object.Creates a shallow copy of the current Object.

(繼承來源 Object)
Remove(String)

SqlConnectionStringBuilder 執行個體移除具有指定之索引鍵的項目。Removes the entry with the specified key from the SqlConnectionStringBuilder instance.

ShouldSerialize(String)

指出這個 SqlConnectionStringBuilder 執行個體中,是否存在指定的索引鍵。Indicates whether the specified key exists in this SqlConnectionStringBuilder instance.

ToString()

傳回與這個 DbConnectionStringBuilder 相關聯的連接字串。Returns the connection string associated with this DbConnectionStringBuilder.

(繼承來源 DbConnectionStringBuilder)
TryGetValue(String, Object)

從這個 SqlConnectionStringBuilder 擷取對應到所提供之索引鍵的值。Retrieves a value corresponding to the supplied key from this SqlConnectionStringBuilder.

明確介面實作

ICollection.CopyTo(Array, Int32)

從特定的 ICollection 索引開始,將 Array 的項目複製到 ArrayCopies the elements of the ICollection to an Array, starting at a particular Array index.

(繼承來源 DbConnectionStringBuilder)
ICollection.IsSynchronized

取得值,該值指出是否同步存取 ICollection (安全執行緒)。Gets a value indicating whether access to the ICollection is synchronized (thread safe).

(繼承來源 DbConnectionStringBuilder)
ICollection.SyncRoot

取得可用來同步存取 ICollection 的物件。Gets an object that can be used to synchronize access to the ICollection.

(繼承來源 DbConnectionStringBuilder)
ICustomTypeDescriptor.GetAttributes()

傳回元件之這個執行個體的自訂屬性集合。Returns a collection of custom attributes for this instance of a component.

(繼承來源 DbConnectionStringBuilder)
ICustomTypeDescriptor.GetClassName()

傳回這個元件執行個體的類別名稱。Returns the class name of this instance of a component.

(繼承來源 DbConnectionStringBuilder)
ICustomTypeDescriptor.GetComponentName()

傳回這個元件執行個體的名稱。Returns the name of this instance of a component.

(繼承來源 DbConnectionStringBuilder)
ICustomTypeDescriptor.GetConverter()

傳回這個元件執行個體的類型轉換子。Returns a type converter for this instance of a component.

(繼承來源 DbConnectionStringBuilder)
ICustomTypeDescriptor.GetDefaultEvent()

為元件的這個執行個體傳回預設事件。Returns the default event for this instance of a component.

(繼承來源 DbConnectionStringBuilder)
ICustomTypeDescriptor.GetDefaultProperty()

為元件的這個執行個體傳回預設屬性。Returns the default property for this instance of a component.

(繼承來源 DbConnectionStringBuilder)
ICustomTypeDescriptor.GetEditor(Type)

為元件的這個執行個體傳回所指定類型的編輯器。Returns an editor of the specified type for this instance of a component.

(繼承來源 DbConnectionStringBuilder)
ICustomTypeDescriptor.GetEvents()

為元件的這個執行個體傳回事件。Returns the events for this instance of a component.

(繼承來源 DbConnectionStringBuilder)
ICustomTypeDescriptor.GetEvents(Attribute[])

使用指定屬性陣列做為篩選條件傳回元件之執行個體的事件。Returns the events for this instance of a component using the specified attribute array as a filter.

(繼承來源 DbConnectionStringBuilder)
ICustomTypeDescriptor.GetProperties()

為元件的這個執行個體傳回屬性。Returns the properties for this instance of a component.

(繼承來源 DbConnectionStringBuilder)
ICustomTypeDescriptor.GetProperties(Attribute[])

使用屬性陣列做為篩選條件,傳回這個元件執行個體的屬性。Returns the properties for this instance of a component using the attribute array as a filter.

(繼承來源 DbConnectionStringBuilder)
ICustomTypeDescriptor.GetPropertyOwner(PropertyDescriptor)

傳回物件,該物件包含指定的屬性描述項所描述的屬性。Returns an object that contains the property described by the specified property descriptor.

(繼承來源 DbConnectionStringBuilder)
IDictionary.Add(Object, Object)

將隨附有索引鍵和值的項目加入至 IDictionary 物件。Adds an element with the provided key and value to the IDictionary object.

(繼承來源 DbConnectionStringBuilder)
IDictionary.Contains(Object)

判斷 IDictionary 物件是否包含具有指定索引鍵的項目。Determines whether the IDictionary object contains an element with the specified key.

(繼承來源 DbConnectionStringBuilder)
IDictionary.GetEnumerator()

傳回 IDictionaryEnumerator 物件的 IDictionary 物件。Returns an IDictionaryEnumerator object for the IDictionary object.

(繼承來源 DbConnectionStringBuilder)
IDictionary.IsFixedSize (繼承來源 DbConnectionStringBuilder)
IDictionary.IsReadOnly (繼承來源 DbConnectionStringBuilder)
IDictionary.Item[Object]

取得或設定具有指定索引鍵的項目。Gets or sets the element with the specified key.

(繼承來源 DbConnectionStringBuilder)
IDictionary.Remove(Object)

IDictionary 物件中移除具有指定索引鍵的項目。Removes the element with the specified key from the IDictionary object.

(繼承來源 DbConnectionStringBuilder)
IEnumerable.GetEnumerator()

傳回逐一查看集合的列舉值。Returns an enumerator that iterates through a collection.

(繼承來源 DbConnectionStringBuilder)

擴充方法

Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

啟用查詢的平行化作業。Enables parallelization of a query.

AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryableConverts an IEnumerable to an IQueryable.

適用於

另請參閱