本文介绍了无法找到所请求的.Net框架数据提供程序。它可能没有安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我第一次在远程服务器上发布实体框架的项目。页面工作正常,但是当我尝试访问我的保留区域,所以阅读一个数据库,我得到这个错误

描述:在执行当前Web请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误的更多信息及其在代码中的起始位置。



异常详细信息:System.ArgumentException:无法找到所请求的.Net Framework数据提供者。可能未安装。



源错误:



在执行当前的过程中生成了未处理的异常网络请求。有关异常的来源和位置的信息可以使用下面的异常堆栈跟踪来识别。

我必须将一些dll复制到我的bin文件夹或修改我的web.config?

解决方案

尝试运行它以获取已安装的提供程序的列表,并检查您的位置:

 code> //此示例假定引用System.Data.Common。 
static DataTable GetProviderFactoryClasses()
{
//检索已安装的提供程序和工厂。
DataTable table = DbProviderFactories.GetFactoryClasses();

//显示每行和列的值。
foreach(table.Rows中的DataRow行)
{
foreach(table.Columns中的DataColumn列)
{
Console.WriteLine(row [column]);
}
}
返回表;
}

更新:您需要在目标机器上安装MySQL提供程序,称为MySQL Connector Net xxx,您可以从本网站


Hi it is my first time that I publish a project deveolped with entity framework in a remote server. The pages work fine but when I try to access in my reserved area and so, reading a dabatase, I obtain this error

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

I have to copy some dll into my bin folder or modify my web.config?

解决方案

Try running this to get a list of installed providers, and check yours is there:

// This example assumes a reference to System.Data.Common.
static DataTable GetProviderFactoryClasses()
{
    // Retrieve the installed providers and factories.
    DataTable table = DbProviderFactories.GetFactoryClasses();

    // Display each row and column value.
    foreach (DataRow row in table.Rows)
    {
        foreach (DataColumn column in table.Columns)
        {
            Console.WriteLine(row[column]);
        }
    }
    return table;
}

UPDATE: You need to have the MySQL Provider installed on the target machine, it's called something like "MySQL Connector Net x.x.x" Which you can get from this website

这篇关于无法找到所请求的.Net框架数据提供程序。它可能没有安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-27 08:28
查看更多