运行项目后我收到此错误。我将远程oracle连接字符串添加到web.config文件中。我没有为Visual Studio 2017下载oracle开发者工具。我正在使用oracle 11g客户端和visual studio 2017 64x,dot.net框架4.任何人都知道无论如何都要解决这个问题。图片编辑。
答案 0 :(得分:0)
请改为尝试:
DbProviderFactory DatabaseFactory = DbProviderFactories.GetFactory(providerName);
using (Database db = DatabaseFactory.CreateConnection())
{
db.ConnectionString = connectionString;
db.Open();
TestContext.WriteLine("Connection established : " + db.State);
db.Close();
}
标题Creating the DbProviderFactory and DbConnection
可能对您有所帮助:https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/obtaining-a-dbproviderfactory