DataSourceCollection.Count property

Office 2013 and later

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)

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

value = instance.Count

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: " & Me.DataSource.Count.ToString())
Show: