Name

SqlParameterCollection

Synopsis

A collection of SqlParameter objects representing the set of parameters for a stored procedure or parameterized query (and set through the SqlCommand.Parameters property). This class also provides an overloaded Add( ) method that allows you to create and add a SqlParameter object to the collection in one step.

public sealed class SqlParameterCollection : MarshalByRefObject, 

     System.Data.IDataParameterCollection, IList, ICollection, IEnumerable {

// Public Instance Properties

   public int Count{get; }                                     // implements ICollection

   public SqlParameter this[string 

                  parameter

                  ]{set; get; } 

   public SqlParameter this[int 

                  index

                  ]{set; get; } 

// Public Instance Methods

   public int Add(object value);              // implements IList

   public SqlParameter Add(SqlParameter value);  

   public SqlParameter Add(string parameterName, object value);

   public SqlParameter Add(string parameterName, System.Data.SqlDbType sqlDbType);

   public SqlParameter Add(string parameterName, System.Data.SqlDbType sqlDbType, int size); 

   public SqlParameter Add(string parameterName,  System.Data.SqlDbType sqlDbType, int size, string sourceColumn);

   public void Clear( );                                        // implements IList

   public bool Contains(object value);              // implements IList

   public bool Contains(string value);             // implements System.Data.IDataParameterCollection

   public void CopyTo(Array array, int index);                // implements ICollection

   public IEnumerator GetEnumerator( );                         // implements IEnumerable

   public int IndexOf(object value);                 // implements IList ...

Get ADO.NET in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.