|
Find All Data Providers Installed On A Machine
This post shows you how to find Data Providers installed on a machine. Data providers in .NET Framework provide the plumbing necessary to connect to databases. There are different data providers available which can connect to SQL Server, Oracle or other databases through OleDb. You can find the data providers installed on your machine by looking at Machine.config file. In particular you will be looking for DbProviderFactories element under System.Data. In the screenshot below you can see data providers installed on my machine.
A list of data providers can also be retrieved by code. This sample shows you how to retrieve a list of data providers in code.
DataTable dataProviders = DbProviderFactories.GetFactoryClasses(); foreach (DataRow provider in dataProviders.Rows) { Console.WriteLine(provider[0].ToString()); }
In the code above I am displaying the name of provider. Here is my output.

Get Updates By Email
Popular Post
- LINQ To SQL Tutorial
- LINQ To SQL Join On Multiple Conditions
- Code Sample: Programmatically Download File Using C#
- Free Icons And Images With Visual Studio 2008
- Windows 7 Control Panel In Classic Mode
- Dynamic Sort With LINQ
- Use SqlConnection With LINQ To SQL
- StyleCop Tutorial
- Write To Vista Event Log Using C#
- More Details Emerge On Microsoft Master Certification
Tag Cloud
Code Snippets
- Get Current Windows User In C#
- Get Width And Height Of Image In C#
- Get Windows Registry Size With WMI And C#
- Reverse Array Elements Using C#
- Convert Hexadecimal To Number In C#
- Get Free Disk Space Using T-SQL
- SQL Server 2008 – Get All Indexes In A Database
- Get Name Of Current Executing Assembly In C#
- Get CD Or DVD Drive Information Using WMI And C#
- Get Last Row From Table Using LINQ To SQL


July 29th, 2010 at 5:41 pm
You can do the same thing in PowerShell by running this one-liner
[System.Data.Common.DbProviderFactories]::GetFactoryClasses() | % { $_.Name }
July 30th, 2010 at 7:41 am
Thanks Ravikanth,
Truly powerful :)