Export (0) Print
Expand All

DbConnectionStringBuilder.EquivalentTo Method

Compares the connection information in this DbConnectionStringBuilder object with the connection information in the supplied object.

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

abstract EquivalentTo : 
        connectionStringBuilder:DbConnectionStringBuilder -> bool  
override EquivalentTo : 
        connectionStringBuilder:DbConnectionStringBuilder -> bool

Parameters

connectionStringBuilder
Type: System.Data.Common.DbConnectionStringBuilder

The DbConnectionStringBuilder to be compared with this DbConnectionStringBuilder object.

Return Value

Type: System.Boolean
true if the connection information in both of the DbConnectionStringBuilder objects causes an equivalent connection string; otherwise false.

Comparisons on key names are case insensitive; value comparisons are case sensitive.

The EquivalentTo method returns true if the key/value pairs are equal, regardless of their order. The connection behavior of the two connection strings are equivalent, because order is never significant within connection strings. However, different order may affect connection pooling behavior of connections based on these connection strings.

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

This sample displays the following output:

builder1 = value1=SomeValue;value2=20;value3=30;value4=40
builder2 = value2=20;value3=30;value4=40;value1=SomeValue
builder3 = value2=20;value3=30;value4=40;value1=SOMEVALUE
builder1.EquivalentTo(builder2) = True
builder2.EquivalentTo(builder3) = False

.NET Framework

Supported in: 4.6, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft