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" )
Workaround:
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=4.121.1.0, Culture= Neutral, publickeytoken=89b483f429c47342 " /> </dbproviderfactories> </System.Data></Configuration>
3, which "version=4.121.1.0", 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} " ----------------- ------ );}
http://www.ereader123.com/
Dbproviderfactories.getfactory Oracle.ManagedDataAccess.Client