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 three intrinsic aliases are the values for the these constants: DbProviderFactory.MSSQL_PROVIDER_NAME, DbProviderFactory.ORACLE_PROVIDER_NAME, and DbProviderFactory.ODPNET_PROVIDER_NAME.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server family
Reference
DbProviderFactory Class
DbProviderFactory Members
Overload List