DbProviderFactories.GetFactoryClasses : DbProviderFactories « System.Data.Common « C# / C Sharp by API






DbProviderFactories.GetFactoryClasses

  

using System;
using System.Data;
using System.Data.Common;

class MainClass
{
    public static void Main(string[] args)
    {
        using (DataTable providers = DbProviderFactories.GetFactoryClasses())
        {
            Console.WriteLine("Available ADO.NET Data Providers:");
            foreach (DataRow prov in providers.Rows)
            {
                Console.WriteLine("Name:{0}", prov["Name"]);
                Console.WriteLine("Description:{0}", prov["Description"]);
                Console.WriteLine("Invariant Name:{0}", prov["InvariantName"]);
            }
        }

    }
}

   
    
  








Related examples in the same category