Dbproviderfactories.getfactory Oracle.ManagedDataAccess.Client

Source: Internet
Author: User

Because of recent projects, to use Microsoft's EF framework without the Oracle client installed, access to the Oracle database. The following code will be called when the error.

System.Data.Common.DbProviderFactories.GetFactory ("Oracle.ManagedDataAccess.Client" )


1. Referring to Oracle: Oracle.ManagedDataAccess.dll

2, add the following content in App. Config:

<Configuration>  <System.Data>    <dbproviderfactories>      <Addname= "Oraclemanageddataaccess Data Provider"invariant= "Oracle.ManagedDataAccess.Client"Description= ". Net Framework Provider for oraclemanageddataaccess"type= "oracle.manageddataaccess.client.oracleclientfactory,oracle.manageddataaccess, Version=, Culture= Neutral, publickeytoken=89b483f429c47342 " />    </dbproviderfactories>  </System.Data></Configuration>

3, which "version=", according to your version modified. Can be viewed with reflector.

4, through the following code, you can check all the successful introduction of the dbproviderfactories

 var  factoryclasses = var  cols = Factoryclasses.columns;  foreach  (DataRow row in   Factoryclasses.rows) { Span style= "color: #0000ff;" >foreach  (DataColumn col in   cols) {Co Nsole. WriteLine (  {0}:{1}   "   ----------------- ------  );}  


Dbproviderfactories.getfactory Oracle.ManagedDataAccess.Client

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.