Search notes:

System.Data.Common.DbProviderFactory (abstract class)

Installed providers that implement DbProviderFactory can be found with System.Data.Common.DbProviderFactories.GetFactoryClasses().

Methods and properties

CanCreateCommandBuilder A boolean that informs if the class supports DbCommandBuilder
CanCreateDataAdapter A boolean that informs if the class supports System.Data.Common.DbDataAdapter
CanCreateDataSourceEnumerator A boolean that informs if the class supports DbDataSourceEnumerator
CreateCommand() Returns an instance of the provider's class that derives from System.Data.Common.DbCommand.
CreateCommandBuilder() Returns an instance of the provider's class that derives from System.Data.Common.DbCommandBuilder.
CreateConnection() Returns an instance of the provider's class that derives from System.Data.Common.DbConnection.
CreateConnectionStringBuilder() Returns an instance of the provider's class that derives from System.Data.Common.DbConnectionStringBuilder.
CreateDataAdapter() Returns an instance of the provider's class that derives from System.Data.Common.DbDataAdapter.
CreateDataSourceEnumerator() Returns an instance of the provider's class that derives from System.Data.Common.DbDataSourceEnumerator.
CreateParameter() Returns an instance of the provider's class that derives from System.Data.Common.DbParameter.

PowerShell script to print a factory's properties

The following PowerShell script iterates over all DbProviderFactory instances that are returned by DbProviderFactories.GetFactoryClasses() and prints their name, description and properties.
foreach ($factoryClass in [System.Data.Common.DbProviderFactories]::GetFactoryClasses()) {

   write-host "$($factoryClass.description) ($($factoryClass.name))"

   $factory = [System.Data.Common.DbProviderFactories]::GetFactory($factoryClass.InvariantName)

   "  CanCreateDataSourceEnumerator: $($factory.CanCreateDataSourceEnumerator)"


   if ($psVersionTable.psEdition -eq 'Core') {
    #
    # Apparently, the following properites are only available in .NET Core.
    #
      "  CanCreateCommandBuilder      : $($factory.CanCreateCommandBuilder      )"
      "  CanCreateDataAdapter         : $($factory.CanCreateDataAdapter         )"
   }

   write-host
}

See also

System.Data.Common.DbProviderFactories

Index