ContainsKey Method

DbConnectionStringBuilder.ContainsKey Method

Determines whether the DbConnectionStringBuilder contains a specific key.

Namespace: System.Data.Common
Assembly: System.Data (in

virtual bool ContainsKey (
	String^ keyword
public boolean ContainsKey (
	String keyword
public function ContainsKey (
	keyword : String
) : boolean
Not applicable.



The key to locate in the DbConnectionStringBuilder.

Return Value

true if the DbConnectionStringBuilder contains an entry with the specified key; otherwise false.

Exception typeCondition


keyword is a null reference (Nothing in Visual Basic).

No code example is currently available or this language may not be supported.

This code produces the following output:

Contents of the DbConnectionStringBuilder:
properties="Excel 8.0;HDR=Yes;IMEX=1"
The collection contains the key "Data Source".

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

© 2016 Microsoft