asp.net.ph

SqlParameterCollection.Count Property

System.Data.SqlClient Namespace   SqlParameterCollection Class


Returns the number of parameters in the collection.

Syntax


Script [ integer variable = ] SqlParameterCollection.Count

Property Value


variable The number of SqlParameter objects in the collection.

Implements

ICollection.Count

Example

The following example shows use of the Count property to set the upper bound of a loop that displays the name of each SqlParameter object in a given SqlParameterCollection.

public void CreateSqlParamColl ( SqlCommand myCmd ) {
   SqlParameterCollection myParams = myCmd.Parameters;
   string myParamNames = "";

   for ( int i=0; i < myParams.Count; i++ ) {
      myParamNames += myParams [ ].ToString ( ) + "\n";
   }
   MessageBox.Show ( myParamNames );
}
  C# VB

See Also

SqlParameterCollection Members 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