Count Property
Collapse the table of content
Expand the table of content
This documentation is archived and is not being maintained.

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)

public abstract int Count { get; }

Property Value

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

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.

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());
Show:
© 2016 Microsoft