System.Data.OleDb Namespace OleDbParameterCollection Class
Returns the number of parameters in the collection.
Script |
[ integer variable = ] OleDbParameterCollection.Count |
ICollection.Count
The following example shows use of the Count property to set the upper bound of a loop that displays the name of each OleDbParameter object in a given OleDbParameterCollection.
public void CreateOleDbParamColl ( OleDbCommand myCmd ) {
OleDbParameterCollection myParams = myCmd.Parameters;
string myParamNames = "";
for ( int i=0; i < myParams.Count; i++ ) {
myParamNames += myParams [ ].ToString ( ) + "\n";
}
MessageBox.Show ( myParamNames );
}
Public Sub CreateOleDbParamColl ( myCmd As OleDbCommand )
Dim myParams As OleDbParameterCollection = myCmd.Parameters
Dim myParamNames As String = ""
Dim i As Integer
For i = 0 To myParams.Count - 1
myParamNames += myParams ( i ).ToString ( ) + ControlChars.Cr
Next i
MessageBox.Show ( myParamNames )
End Sub |
|
C# |
VB |
OleDbParameterCollection Members