Represents a Universal Data Connection (UDC) file located in the central data connection store on a server farm.
Assembly: Microsoft.Office.InfoPath.Server (in Microsoft.Office.InfoPath.Server.dll)
The UDC files that are available on the server farm are listed on the Manage Data Connection Files page of the Central Administration site. A version 2 UDC file with the *.udcx file extension is designed for use by browser-enabled form templates that render in the browser or open in the InfoPath editor. Form templates that are not browser-enabled can also use UDC connection files.
In the following example, the DataConnectionFileCollection collection is used to loop through every UDC file on the server farm and write its display name to the console. Then the total number of UDC files on the server is written to the console.
Dim LocalFormsService As FormsService Dim LocalFarm As SPFarm Dim UdcCollection As DataConnectionFileCollection Dim UdcConnection As DataConnectionFile Dim CountUdcFiles As Integer = 0 Try LocalFarm = SPFarm.Local LocalFormsService = LocalFarm.Services.GetValue(Of FormsService)(FormsService.ServiceName) UdcCollection = LocalFormsService.DataConnectionFiles For Each UdcConnection In UdcCollection CountUdcFiles = CountUdcFiles + 1 Console.WriteLine("UDC file # " + CountUdcFiles.ToString() + ": " + UdcConnection.DisplayName.ToString()) Next Console.WriteLine("Total UDC files on server: " + CountUdcFiles.ToString()) Console.Write("Press Enter to Continue") Console.ReadLine() Catch ex As Exception Console.WriteLine("Error: " + ex.Message) Console.Write("Press Enter to Continue") Console.ReadLine() End Try