简体   繁体   English

网格视图错误 Visual Studio 2010 asp.NET 框架 4. 找不到 .NET 框架提供程序

[英]Grid View Error Visual Studio 2010 asp.NET Framework 4. Unable to find .NET Framework Provider

I have an SQL Compact edition database as a local file.我有一个 SQL 精简版数据库作为本地文件。 I'm using Visual Studio 2010 to access the database and make my asp.NET website.我正在使用 Visual Studio 2010 访问数据库并创建我的 asp.NET 网站。

In my aspx page design view, the data displays fine, and when I configure it and run a test query, it works fine...在我的 aspx 页面设计视图中,数据显示正常,当我对其进行配置并运行测试查询时,它工作正常......

However When I run my page I get this strange Error.但是,当我运行我的页面时,我得到了这个奇怪的错误。

Unable to find the requested .Net Framework Data Provider.  It may not be installed.

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.

Stack Trace:

[ArgumentException: Unable to find the requested .Net Framework Data Provider.  It may not be installed.]
    System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) +1402071
    System.Web.UI.WebControls.SqlDataSource.GetDbProviderFactory() +67
    System.Web.UI.WebControls.SqlDataSource.GetDbProviderFactorySecure() +22
    System.Web.UI.WebControls.SqlDataSource.CreateConnection(String connectionString) +11
    System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +117
    System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +21
    System.Web.UI.WebControls.DataBoundControl.PerformSelect() +143
    System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
    System.Web.UI.WebControls.GridView.DataBind() +4
    System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +66
    System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +75
    System.Web.UI.Control.EnsureChildControls() +102
    System.Web.UI.Control.PreRenderRecursiveInternal() +42
    System.Web.UI.Control.PreRenderRecursiveInternal() +175
    System.Web.UI.Control.PreRenderRecursiveInternal() +175
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496

I for one, have no idea what this is... I have scoured the net and found that it MAY have something to do with my web.config file.我一个,不知道这是什么......我在网上搜索了一下,发现它可能与我的 web.config 文件有关。 My aspx code is:我的 aspx 代码是:

<asp:SqlDataSource ID="pending" runat="server"
    ConnectionString="<%$ ConnectionStrings:ConnectionString %>"                

    SelectCommand="SELECT u.firstName, u.surname, w.url, c.companyName, o.cost FROM Website AS w INNER JOIN Orders AS o ON w.webID = o.websiteID INNER JOIN Company AS c ON w.companyID = c.companyID INNER JOIN Users AS u ON c.userID = u.userID WHERE (o.completed = 'N')" 
    ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>">
</asp:SqlDataSource>

<asp:GridView ID="grid" runat="server" AutoGenerateColumns="False" 
    <Columns>
        <asp:CommandField ShowSelectButton="True" />
        <asp:BoundField DataField="firstName" HeaderText="firstName" ReadOnly="True" 
            SortExpression="firstName" />
        <asp:BoundField DataField="surname" HeaderText="surname" ReadOnly="True" 
            SortExpression="surname" />
        <asp:BoundField DataField="url" HeaderText="url" ReadOnly="True" 
            SortExpression="url" />
        <asp:BoundField DataField="companyName" HeaderText="companyName" 
            ReadOnly="True" SortExpression="companyName" />
        <asp:BoundField DataField="cost" HeaderText="cost" ReadOnly="True" 
            SortExpression="cost" />
    </Columns>
</asp:GridView>

And my web config is:我的 web 配置是:

<?xml version="1.0"?>
<configuration>
<connectionStrings>
        <add name="ConnectionString" connectionString="Data Source=Database.sdf;Password=XXXX;Persist Security Info=True"
            providerName="Microsoft.SqlServerCe.Client.3.5" />
    </connectionStrings>
    <system.web>
        <compilation debug="true" targetFramework="4.0">
        <assemblies>
            <add assembly="Accessibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            </assemblies>
        </compilation>
        <authorization>
            <deny users="?" />
        </authorization>
    </system.web>
</configuration>

Sorry for the LONG Post... But I really cant see the problem and i wont waste another 2 hours of my life trying to fix this!很抱歉,很长的帖子……但我真的看不到问题所在,我不会再浪费 2 个小时的时间来解决这个问题!

Thank you!谢谢!

Basically my site runs fine without the GridView.基本上我的网站在没有 GridView 的情况下运行良好。 As soon as I add it, the web browser appears with that error.一旦我添加它,web 浏览器就会出现该错误。

Ive added the Microsoft.SqlServerCe.Client factory in the config...Still nothing我已经在配置中添加了 Microsoft.SqlServerCe.Client 工厂......仍然没有

We had a similar problem.我们遇到了类似的问题。 Turns out the SQL CE assembly was not on the target server, it is not a default part of the .NET Framework it is a secondary install.原来 SQL CE 程序集不在目标服务器上,它不是 .NET 框架的默认部分,它是辅助安装。 By including the SQL Server CE Assembly in our bin directory during deployment we were able to get everything running.通过在部署期间将 SQL 服务器 CE 组件包含在我们的 bin 目录中,我们能够让一切运行起来。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ASP.Net无法找到.Net Framework Provider - ASP.Net Unable to find .Net Framework Provider 在 Visual Studio 2010 Professional 中找不到请求的 .Net Framework 数据提供程序 - Unable to find the requested .Net Framework Data Provider in Visual Studio 2010 Professional 带有MySql的ASP.Net MVC - 无法找到请求的.Net Framework数据提供程序 - ASP.Net MVC with MySql - unable to find the requested .Net Framework Data Provider 找不到请求的.NET Framework数据提供程序。 它可能没有安装。 在ASP.Net MVC4中 - Unable to find the requested .NET Framework Data Provider. It may not be installed. In ASP.Net MVC4 如何在Visual Studio 2010上显示ASP.NET图表(框架4.0)? - How to display ASP.NET Charts (Framework 4.0) on Visual Studio 2010? 设计模式问题:将ASP.net Web应用程序框架1.1迁移到Visual Studio 2010 - Issue with design mode: Migrated ASP.net web application framework 1.1 to Visual Studio 2010 Visual Studio 2010 RC + ASP.NET MVC 2 RTM不会从.NET Framework 4重新定位到3.5 - Visual Studio 2010 RC + ASP.NET MVC 2 RTM won't re-target from .NET Framework 4 to 3.5 无法连接到ASP.NET开发服务器错误Visual Studio 2010 - Unable to connect to ASP.NET development server error visual studio 2010 visual studio asp.net mvc,更改目标框架 - visual studio asp.net mvc, changing target framework Visual Studio asp.net完整框架项目中的Bootstrap 4 - Bootstrap 4 in Visual Studio asp.net full framework project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM