Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

DbConnectionStringBuilder::Remove Method

Removes the entry with the specified key from the DbConnectionStringBuilder instance.

Namespace:  System.Data.Common
Assembly:  System.Data (in System.Data.dll)
public:
virtual bool Remove(
	String^ keyword
)

Parameters

keyword
Type: System::String
The key of the key/value pair to be removed from the connection string in this DbConnectionStringBuilder.

Return Value

Type: System::Boolean
true if the key existed within the connection string and was removed; false if the key did not exist.
ExceptionCondition
ArgumentNullException

keyword is null (Nothing in Visual Basic)

NotSupportedException

The DbConnectionStringBuilder is read-only, or the DbConnectionStringBuilder has a fixed size.

Because the Remove method returns a value that indicates its success, it is not required to look for the key before trying to remove the key/value pair from the DbConnectionStringBuilder instance.

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

This sample displays the following output:

Removed 'Provider'
data source=C:\Demo.mdb;jet oledb:system database=system.mdw
Unable to remove 'User ID'
data source=C:\Demo.mdb;jet oledb:system database=system.mdw
Removed 'DATA SOURCE'
jet oledb:system database=system.mdw

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.