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

IDataParameterCollection Interface

Collects all parameters relevant to a Command object and their mappings to DataSet columns, and is implemented by .NET Framework data providers that access data sources.

Namespace: System.Data
Assembly: System.Data (in system.data.dll)

public interface IDataParameterCollection : IList, ICollection, IEnumerable
public interface IDataParameterCollection extends IList, ICollection, 
	IEnumerable
public interface IDataParameterCollection extends IList, ICollection, 
	IEnumerable

The IDataParameterCollection interface allows an inheriting class to implement a Parameter collection. For more information about Parameter classes, see Using Stored Procedures with a Command. For more information about implementing .NET Framework data providers, see Implementing a .NET Framework Data Provider.

An application does not create an instance of the IDataParameterCollection interface directly, but creates an instance of a class that inherits IDataParameterCollection.

Classes that inherit IDataParameterCollection must implement the inherited members, and typically define additional members to add provider-specific functionality. For example, the IDataParameterCollection interface defines one implementation of the RemoveAt method. In turn, the OleDbParameterCollection class inherits this method, and defines two additional overloads of RemoveAt.

Notes to Implementers When you inherit from the IDataParameterCollection interface, you should implement the following constructor:

Item

Description

PrvParameterCollection()

Creates an empty PrvParameterCollection class.

The following example creates multiple instances of the derived class, SqlParameter, through the SqlParameterCollection collection within the SqlDataAdapter. These parameters are used to select data from the data source and place the data in the DataSet. This example assumes that a DataSet and a SqlDataAdapter have already been created with the appropriate schema, commands, and connection.

public void AddSqlParameters() 
{
// ...
// create categoriesDataSet and categoriesAdapter
// ...

  categoriesAdapter.SelectCommand.Parameters.Add(
    "@CategoryName", SqlDbType.VarChar, 80).Value = "toasters";
  categoriesAdapter.SelectCommand.Parameters.Add(
    "@SerialNum", SqlDbType.Int).Value = 239;
  categoriesAdapter.Fill(categoriesDataSet);



Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

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

.NET Framework

Supported in: 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.