SqlDataSource.GetDbProviderFactory SqlDataSource.GetDbProviderFactory SqlDataSource.GetDbProviderFactory SqlDataSource.GetDbProviderFactory Method

定义

返回与 DbProviderFactory 属性所标识的 ADO.NET 提供程序相关联的 ProviderName 对象。Returns the DbProviderFactory object that is associated with the ADO.NET provider that is identified by the ProviderName property.

protected:
 virtual System::Data::Common::DbProviderFactory ^ GetDbProviderFactory();
protected virtual System.Data.Common.DbProviderFactory GetDbProviderFactory ();
abstract member GetDbProviderFactory : unit -> System.Data.Common.DbProviderFactory
override this.GetDbProviderFactory : unit -> System.Data.Common.DbProviderFactory
Protected Overridable Function GetDbProviderFactory () As DbProviderFactory

返回

一个表示已标识的 ADO.NET 提供程序的 DbProviderFactory;如果没有设置任何提供程序,则为 System.Data.SqlClient 的一个实例。A DbProviderFactory that represents the identified ADO.NET provider; otherwise, and instance of the System.Data.SqlClient, if no provider is set.

注解

DbProviderFactory属性由SqlDataSource控件用于在与数据库交互时创建正确的 ADO.NET 连接、命令和参数对象。The DbProviderFactory property is used by the SqlDataSource control to create the correct ADO.NET connection, command, and parameter objects when interacting with a database.

适用于

另请参阅