Share via


DataSourceCollection.Count property

Gets a count of the number of DataSource objects contained in the DataSourceCollection.

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

Syntax

'Declaration
Public MustOverride ReadOnly Property Count As Integer
    Get
'Usage
Dim instance As DataSourceCollection
Dim value As Integer

value = instance.Count
public abstract int Count { get; }

Property value

Type: System.Int32
The number of DataSource objects in the DataSourceCollection.

Remarks

This member can be accessed without restrictions.

This type or member can be accessed from code running in forms opened in Microsoft InfoPath Filler or in a Web browser.

Examples

In the following example, the Count property of the DataSourceCollection is used to display a count of the number of DataSource objects in the collection.

MessageBox.Show(
   "DataSource count: " + this.DataSource.Count.ToString());
MessageBox.Show(
   "DataSource count: " & Me.DataSource.Count.ToString())

See also

Reference

DataSourceCollection class

DataSourceCollection members

Microsoft.Office.InfoPath namespace