DbConnectionStringBuilder.Remove Method (String)


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

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

abstract Remove : 
        keyword:string -> bool
override Remove : 
        keyword:string -> bool


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.

Exception Condition

keyword is null (Nothing in Visual Basic)


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
jet oledb:system database=system.mdw

Universal Windows Platform
Available since 10
.NET Framework
Available since 2.0
Return to top