DataAdapters.Item property

Gets a reference to the specified data adapter object from the DataAdaptersCollection collection, based on position or name.

Namespace:  Microsoft.Office.Interop.InfoPath
Assembly:  Microsoft.Office.Interop.InfoPath (in Microsoft.Office.Interop.InfoPath.dll)

Syntax

'Declaration
ReadOnly Default Property Item ( _
    varIndex As Object _
) As Object
    Get
'Usage
Dim instance As DataAdapters
Dim varIndex As Object
Dim value As Object

value = instance(varIndex)
Object this[
    Object varIndex
] { get; }

Parameters

  • varIndex
    Type: System.Object

    An expression that specifies the position of a member of the DataAdaptersCollection collection. If the argument is a numeric expression, it must be a number from 0 to the value of the Count property minus 1. If the argument is a string expression, it must be the name of a member of the collection.

Property value

Type: System.Object

Remarks

If the value provided for the varIndex argument does not match any existing member of the collection, an error occurs.

After you have set a reference to the DataSourceObject object that the Item property returns, you can access any of its properties or methods after the object has been cast to the appropriate DataObject object.

Examples

Because the Item property is the default property of the DataAdaptersCollection collection, it can be used after casting to the appropriate data adapter as follows:

EmailAdapterObject myEmailAdapter = ((EmailAdapterObject)thisXDocument.DataAdapters[3]);

See also

Reference

DataAdapters interface

DataAdapters members

Microsoft.Office.Interop.InfoPath namespace