OdbcParameterCollection.Contains Method

Definition

Gets a value indicating whether an OdbcParameter object exists in the collection.

Overloads

Contains(OdbcParameter)

Determines whether the specified OdbcParameter is in this OdbcParameterCollection.

Contains(Object)

Determines whether the specified Object is in this OdbcParameterCollection.

Contains(String)

Gets a value indicating whether an OdbcParameter object with the specified parameter name exists in the collection.

Contains(OdbcParameter)

Source:
OdbcParameterCollection.cs
Source:
OdbcParameterCollection.cs
Source:
OdbcParameterCollection.cs

Determines whether the specified OdbcParameter is in this OdbcParameterCollection.

C#
public bool Contains (System.Data.Odbc.OdbcParameter value);

Parameters

value
OdbcParameter

The OdbcParameter value.

Returns

true if the OdbcParameter is in the collection; otherwise, false.

See also

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

Contains(Object)

Source:
OdbcParameterCollectionHelper.cs
Source:
OdbcParameterCollectionHelper.cs
Source:
OdbcParameterCollectionHelper.cs

Determines whether the specified Object is in this OdbcParameterCollection.

C#
public override bool Contains (object value);
C#
public bool Contains (object value);

Parameters

value
Object

The Object value.

Returns

true if the OdbcParameterCollection contains the value; otherwise, false.

Implements

See also

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)

Contains(String)

Source:
OdbcParameterCollection.cs
Source:
OdbcParameterCollection.cs
Source:
OdbcParameterCollection.cs

Gets a value indicating whether an OdbcParameter object with the specified parameter name exists in the collection.

C#
public override bool Contains (string value);
C#
public bool Contains (string value);

Parameters

value
String

The name of the OdbcParameter object to find.

Returns

true if the collection contains the parameter; otherwise, false.

Implements

Examples

The following example searches for an OdbcParameter with a given ParameterName within an OdbcParameterCollection. If the parameter exists, the example displays the name and index of the parameter. If the parameter does not exist, the example displays an error. This example assumes that an OdbcParameterCollection has already been created.

C#
public void SearchParameters()
{
    // ...
    // create OdbcParameterCollection parameterCollection
    // ...
    if (!parameterCollection.Contains("Description"))
        Console.WriteLine("ERROR: no such parameter in the collection");
    else
        Console.WriteLine("Name: " + parameterCollection["Description"].ToString() +
            "Index: " + parameterCollection.IndexOf("Description").ToString());
}

See also

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)