Click or drag to resize

DatasourceGetDatasourcesList Method

Returns the list of datasources for a specified database type.

Namespace:  HiTSoftware.DBMoto.Application
Assembly:  APILibrary (in APILibrary.dll) Version: 7.0.0.0 (9.8.1.7)
Syntax
public static Datasource[] GetDatasourcesList(
	DatabaseType dbType
)

Parameters

dbType
Type: HiTSoftware.DBMoto.ApplicationDatabaseType
Database type from which to retrieve the datasource list

Return Value

Type: Datasource
List of datasources supported for the indicated database type
Examples
using System;
using System.Collections.Generic;
using System.Text;
using HiTSoftware.DBMoto.Application;
using HiTSoftware.DBMoto.ObjectModel;

namespace APISamples
{
    /// <summary>
    /// This example shows how to retrieve the list of supported providers in DBMoto
    /// </summary>
    public class SampleProviderList
    {
        public static void Main()
        {
            // Return all supported datasources for DB2 UDB
            Datasource[] datasourceList = Datasource.GetDatasourcesList(DatabaseType.DB2UDB);

            // Print results
            for (int i = 0; i < datasourceList.Length; i++)
            {
                Console.WriteLine("Datasource name: '" + datasourceList[i].name + "' description: " + datasourceList[i].description);
            }

            // Return all supported providers for DB2 UDB
            Provider[] providerList = Provider.GetProvidersList(DatabaseType.DB2UDB);

            // Print results
            for (int i = 0; i < providerList.Length; i++)
            {
                Console.WriteLine("Provider name: '" + providerList[i].name + "' description: " + providerList[i].description);
            }
        }
    }
}
See Also