Touchstone Re 2023 API Reference
GetDataSources Method
Example 


Air.Services.Proxy Assembly > (Global) Namespace > DataSourceManagementServiceClient Class : GetDataSources Method
Contains a GetDataSourcesRequest that identifies the Business Unit SID and SQL Instance SID associated with the list of Data Sources that you want to retrieve.
Retrieves a list of all existing Touchstone® SQL Data Sources that are registered with the Touchstone application.

A Data Source is a SQL Exposure or Results database.

Use the GetDataSources() method to find out the name and Touchstone-generated Data Source Sequential Identifier (SID) of each Data Source that is registered with the Touchstone application.

Syntax
Public Function GetDataSources( _
   ByVal request As GetDataSourcesRequest _
) As GetDataSourcesResponse
Dim instance As DataSourceManagementServiceClient
Dim request As GetDataSourcesRequest
Dim value As GetDataSourcesResponse
 
value = instance.GetDataSources(request)

Parameters

request
Contains a GetDataSourcesRequest that identifies the Business Unit SID and SQL Instance SID associated with the list of Data Sources that you want to retrieve.

Return Value

A GetDataSourcesResponse containing a list of Data Sources that are registered with the Touchstone application.
Remarks
To find the Business Unit SID to pass into this method, call the GetBusinessUnits() method.

To find the SQL Instance SID to pass into this method, call the GetSqlInstances() method.

Example
The following example shows how to retrieve a list of all Touchstone Data Sources that are registered with the Touchstone application using the GetDataSources() method:
using System;
using AIR.Services.Common.Data;
using AIR.Services.DataSourceManagement.Api;
using AIR.Services.DataSourceManagement.Data;
            
class SnippetGetDataSourcesRequest
{
    private static void GetDataSources(int businessUnitSid, int sqlInstanceSid, string dataServerName)
    {
        DataSourceManagementServiceClient dsClient = new DataSourceManagementServiceClient();
        GetDataSourcesRequest request = new GetDataSourcesRequest();
        request.BusinessUnitSid = businessUnitSid;
        request.SqlInstanceSid = sqlInstanceSid;
        request.DataServerName = dataServerName;
        GetDataSourcesResponse response = dsClient.GetDataSources(request);
        if (response.Status.Code == StatusCode.Success)
        {
            foreach (DataSource ds in response.DataSources)
            {
                Console.WriteLine("SID: " + ds.Sid);
                Console.WriteLine("Name: " + ds.Name);
                Console.WriteLine("Description: " + ds.Description);
                Console.WriteLine("Registered: " + ds.Registered.ToString());
                Console.WriteLine("Type: " + ds.Type);
            }
        }
    }
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

DataSourceManagementServiceClient Class
DataSourceManagementServiceClient Members