CreateProvider(String) Method
A provider alias that matches one of the intrinsic provider aliases, one configured in the application configuration file, or a null reference (Nothing in Visual Basic) for the default alias
Creates a new instance of a DbProvider object from the specified provider alias
Syntax
'Declaration
Public Overloads Shared Function CreateProvider( _
ByVal _providerAlias_ As String _
) As DbProvider
public static DbProvider CreateProvider(
string _providerAlias_
)
Parameters
providerAlias
A provider alias that matches one of the intrinsic provider aliases, one configured in the application configuration file, or a null reference (Nothing in Visual Basic) for the default alias
Return Value
A new DbProvider instance configured for the given alias
Exceptions
Exception | Description |
---|---|
CommonException | Error Code 5012 No provider with the specified alias is configured |
Remarks
The two intrinsic aliases are the values for the two constants: DbProviderFactory.MSSQL_PROVIDER_NAME and DbProviderFactory.ORACLE_PROVIDER_NAME. To configure additional aliases, please see the guide to Configure Custom Data Providers.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
Reference
DbProviderFactory Class
DbProviderFactory Members
Overload List