asp.net.ph

ParameterCollection Class

System.Web.UI.WebControls Namespace


.NET Framework version 2.0

Represents a collection of Parameter and Parameter-derived objects that are used by data source controls in advanced data-binding scenarios.

ParameterCollection Class Members

Collapse   Constructors

Visibility Constructor Parameters
public ParameterCollection ( )

Collapse   Properties

Visibility Name Value Type Accessibility
public Item ( String name ) Parameter [ Get , Set ]
public Item ( Int32 index ) Parameter [ Get , Set ]

Collapse   Methods

Visibility Name Parameters Return Type
public Add ( String name , TypeCode type , String value ) Int32
public Add ( String name , DbType dbType , String value ) Int32
public Add ( Parameter parameter ) Int32
public Add ( String name , String value ) Int32
public Contains ( Parameter parameter ) Boolean
public CopyTo ( Parameter parameterArray , Int32 index ) Void
protected CreateKnownType ( Int32 index ) Object
protected GetKnownTypes ( ) Type
public GetValues ( HttpContext context , Control control ) IOrderedDictionary
public IndexOf ( Parameter parameter ) Int32
public Insert ( Int32 index , Parameter parameter ) Void
protected OnClearComplete ( ) Void
protected OnInsert ( Int32 index , Object value ) Void
protected OnInsertComplete ( Int32 index , Object value ) Void
protected OnParametersChanged ( EventArgs e ) Void
protected OnRemoveComplete ( Int32 index , Object value ) Void
protected OnValidate ( Object o ) Void
public Remove ( Parameter parameter ) Void
public RemoveAt ( Int32 index ) Void
protected SetDirtyObject ( Object o ) Void
public UpdateValues ( HttpContext context , Control control ) Void

Collapse   Events

Multicast Name Type
multicast ParametersChanged EventHandler

Remarks

The ParameterCollection class represents a collection of Parameter objects used in advanced data-binding scenarios with data source controls. The Parameter objects are used to bind the values contained by local Page variables, HTTP cookies, session variables, and other controls' values to data source controls when retrieving, updating, deleting, and inserting data.

Use the ParameterCollection class to programmatically manage a set of Parameter objects. You can add, insert, and remove Parameter objects using the appropriate methods of the ParameterCollection class. To programmatically retrieve Parameter objects from a collection, use one of following methods:

  • Use the indexer to get a single Parameter object from the collection, by name or using array notation.
  • Use the GetEnumerator method to create a System.Collections.IEnumerator-implemented object, which can then be used to get items from the collection.

The Count property specifies the total number of items in the collection, and is used to determine the upper bound of the collection. You can add and remove items from the collection by using the Add, Insert, Remove, and RemoveAt methods.

Depending on the implementation and the semantics of a particular data source control, the order in which the parameters are stored in the ParameterCollection collection might be important. For example, when using the SqlDataSource control as an ODBC data source, the order of the Parameter objects in the ParameterCollection collection must be the same as the order of the parameters in the parameterized SQL queries you use. However, when using the SqlDataSource control with Microsoft SQL Server, the order of the Parameter objects is not important.

The following table lists the different parameter classes and how they are used.

Parameter Class Description
Parameter The base parameter class. Use it to bind to a local variable or any static string using the DefaultValue property.
ControlParameter A parameter that can be used to bind to a control's property or method return value.
CookieParameter A parameter that can be used to bind to the value of a cookie.
FormParameter A parameter that can be used to bind to an attribute of the current Web Forms page.
QueryStringParameter A parameter that can be used to bind to a value passed to a Web Forms page on a query string.
SessionParameter A parameter that can be used to bind to the value of a session variable.
ProfileParameter A parameter that can be used to bind to the value of an ASP.NET Profile property.

Example

Skip Navigation Links



Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph