asp.net.ph

SqlParameterCollection Class

System.Data.SqlClient Namespace


Represents the collection of parameters for an SqlCommand.

SqlParameterCollection Class Members

Collapse   Properties

Visibility Name Value Type Accessibility
public Count Int32 [ Get ]
public IsFixedSize Boolean [ Get ]
public IsReadOnly Boolean [ Get ]
public IsSynchronized Boolean [ Get ]
public Item ( String parameterName ) SqlParameter [ Get , Set ]
public Item ( Int32 index ) SqlParameter [ Get , Set ]
public SyncRoot Object [ Get ]

Collapse   Methods

Visibility Name Parameters Return Type
public Add ( String parameterName , SqlDbType sqlDbType , Int32 size ) SqlParameter
public Add ( String parameterName , SqlDbType sqlDbType , Int32 size , String sourceColumn ) SqlParameter
public Add ( Object value ) Int32
public Add ( String parameterName , SqlDbType sqlDbType ) SqlParameter
public Add ( SqlParameter value ) SqlParameter
public Add ( String parameterName , Object value ) SqlParameter
public AddRange ( Array values ) Void
public AddRange ( SqlParameter values ) Void
public AddWithValue ( String parameterName , Object value ) SqlParameter
public Clear ( ) Void
public Contains ( String value ) Boolean
public Contains ( SqlParameter value ) Boolean
public Contains ( Object value ) Boolean
public CopyTo ( Array array , Int32 index ) Void
public CopyTo ( SqlParameter array , Int32 index ) Void
public GetEnumerator ( ) IEnumerator
protected GetParameter ( Int32 index ) DbParameter
protected GetParameter ( String parameterName ) DbParameter
public IndexOf ( Object value ) Int32
public IndexOf ( SqlParameter value ) Int32
public IndexOf ( String parameterName ) Int32
public Insert ( Int32 index , SqlParameter value ) Void
public Insert ( Int32 index , Object value ) Void
public Remove ( Object value ) Void
public Remove ( SqlParameter value ) Void
public RemoveAt ( String parameterName ) Void
public RemoveAt ( Int32 index ) Void
protected SetParameter ( String parameterName , DbParameter value ) Void
protected SetParameter ( Int32 index , DbParameter value ) Void

Remarks

The SqlParameterCollection represents the set of parameters defined for a given SqlCommand. This collection is accessed via the SqlCommand.Parameters property.

Like most data collections in ADO.NET, the SqlParameterCollection uses standard collection methods such as Add, Clear, and Remove. In addition, the Contains method can be used to check for the existence of a particular parameter in the collection.

The number of parameters in the collection must be equal to the number of parameter placeholders within the command text; otherwise, SQL Server™ raises an error.

See Also

SqlParameter   SqlCommand.Parameters 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