System.Data.OleDb Namespace OleDbParameterCollection Class
Returns the OleDbParameter at the specified index.
OleDbParameter variable = OleDbParameterCollection.Item [ index ];
... or ...
OleDbParameter variable = OleDbParameterCollection [ index ];
dim variable as OleDbParameter = OleDbParameterCollection.Item ( index )
... or ...
dim variable as OleDbParameter = OleDbParameterCollection ( index )
variable : OleDbParameter = OleDbParameterCollection.Item ( index );
... or ...
variable : OleDbParameter = OleDbParameterCollection ( index ); |
|
C# |
VB |
JScript |
- index
- The zero-based index of the parameter to retrieve.
The OleDbParameter at the specified index.
The following example shows use of the Item property to display 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 [ i ].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 OleDbParameterCollection.Item Overload List