asp.net.ph

Parameter Class

System.Web.UI.WebControls Namespace


.NET Framework version 2.0

Provides a mechanism that data source controls use to bind to application variables, user identities and choices, and other data. Serves as the base class for all ASP.NET parameter types.

Parameter Class Members

Collapse   Constructors

Visibility Constructor Parameters
public Parameter ( )
public Parameter ( String name )
public Parameter ( String name , DbType dbType )
public Parameter ( String name , DbType dbType , String defaultValue )
public Parameter ( String name , TypeCode type )
public Parameter ( String name , TypeCode type , String defaultValue )

Collapse   Properties

Visibility Name Value Type Accessibility
public ConvertEmptyStringToNull Boolean [ Get , Set ]
public DbType DbType [ Get , Set ]
public DefaultValue String [ Get , Set ]
public Direction ParameterDirection [ Get , Set ]
public Name String [ Get , Set ]
public Size Int32 [ Get , Set ]
public Type TypeCode [ Get , Set ]

Collapse   Methods

Visibility Name Parameters Return Type
protected Clone ( ) Parameter
public static ConvertDbTypeToTypeCode ( DbType dbType ) TypeCode
public static ConvertTypeCodeToDbType ( TypeCode typeCode ) DbType
public GetDatabaseType ( ) DbType
protected LoadViewState ( Object savedState ) Void
protected OnParameterChanged ( ) Void
protected SaveViewState ( ) Object
public ToString ( ) String
protected TrackViewState ( ) Void

Remarks

The Parameter class represents a Parameter in a parameterized SQL query, a filtering expression, or a business object method call that an ASP.NET data source control uses to select, filter, or modify data. Parameter objects are contained in a ParameterCollection object. Parameter objects are evaluated at run time, to bind the values of the variables they represent to whatever method is used by a data source control to interact with data.

Use the Parameter classes that are provided with ASP.NET, including ControlParameter, CookieParameter, SessionParameter, ProfileParameter, and QueryStringParameter, with data source and data-bound controls to build Web-based data applications. These classes are used by data source controls to bind specific kinds of values found in Web applications to placeholders in SQL query strings, business object method parameters, and more. For example, the ControlParameter class is used to bind any public property of a Web server control; the SessionParameter class is used to bind user session values; and the QueryStringParameter and CookieParameter classes are used to bind to values in the HttpRequest class. Extend the base Parameter class when you want to implement your own custom parameter types.

Parameter objects are very simple: they have a Name and a Type property, can be represented declaratively, and can track state across multiple HTTP requests. All parameters support a DefaultValue property, for cases when a parameter is bound to a value, but the value evaluates to a null reference ( Nothing in Visual Basic ) at run time.

When using a collection of Parameter objects with a data source control, their order in the collection might matter. For more information on how parameters are used, see Using Parameters with the SqlDataSource Control and Using Parameters with the ObjectDataSource Control.

See Also

ASP.NET Data Source Controls 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