Get the list of ADO.NET data providers registered in the machine and application configuration file : Data Provider « ADO.Net « C# / CSharp Tutorial






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"]);
            }
        }

    }
}
Available ADO.NET Data Providers:
Name:Odbc Data Provider
Description:.Net Framework Data Provider for Odbc
Invariant Name:System.Data.Odbc
Name:OleDb Data Provider
Description:.Net Framework Data Provider for OleDb
Invariant Name:System.Data.OleDb
Name:OracleClient Data Provider
Description:.Net Framework Data Provider for Oracle
Invariant Name:System.Data.OracleClient
Name:SqlClient Data Provider
Description:.Net Framework Data Provider for SqlServer
Invariant Name:System.Data.SqlClient








32.31.Data Provider
32.31.1.Get the list of ADO.NET data providers registered in the machine and application configuration file
32.31.2.Create Database connection from DbProviderFactory
32.31.3.OleDbProvider