【问题标题】:ASP.NET Publish errorASP.NET 发布错误
【发布时间】:2023-04-11 00:18:01
【问题描述】:

我有一个在 VS 2010、sql server 2008 和 Windows 7 上运行的 Web 应用程序

它在 Visual Studio 和 asp.net 开发服务器上运行良好。

当我点击发布时,我得到一个异常抛出。

The DataSet in data source 'objdatasource1' does not contain any tables. 
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.InvalidOperationException: The DataSet in data   source 'objdatasource1' does not contain any tables.

Source Error: 

这是连接字符串的问题吗?或者是其他东西?

这是我的 web.config

<configuration>
<connectionStrings>
<remove name="DBConnectionString"/>
<add name="DBConnectionString" connectionString="data source=cdstem; Initial Catalog=****; Integrated Security=SSPI;" />
<add name="****ConnectionString" connectionString="Data Source=.;Initial Catalog=****;Integrated Security=True"
  providerName="System.Data.SqlClient" />
</connectionStrings>

在应用程序中,我使用的是“DBConnectionString”,它只是我的本地计算机。

3005 发生未处理的异常。 2011 年 9 月 16 日下午 1:51:41 2011 年 9 月 16 日下午 5:51:41 6609e9834ab3483b8eff8edb3aa5269b 8 1
0 /LM/W3SVC/1/ROOT/MagazineFormatUpdater-3-129606690952604169
完整的 /MagazineFormatUpdater
C:\inetpub\wwwroot\MagazineFormatUpdater\ CHED-JE 6368
w3wp.exe IIS APPPOOL\ASP.NET v4.0 InvalidOperationException
数据源“objdatasource1”中的数据集不包含任何 表。在
System.Web.UI.WebControls.FilteredDataSetHelper.GetDataTable(控制 所有者,对象数据对象)在 System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments 论据)在 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments 参数,DataSourceViewSelectCallback 回调)在 System.Web.UI.WebControls.DataBoundControl.PerformSelect() 在 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() 在 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() 在 System.Web.UI.Control.EnsureChildControls() 在 System.Web.UI.Control.PreRenderRecursiveInternal() 在 System.Web.UI.Control.PreRenderRecursiveInternal() 在 System.Web.UI.Control.PreRenderRecursiveInternal() 在 System.Web.UI.Page.ProcessRequestMain(布尔值 includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

/MagazineFormatUpdater/default.aspx ::1 假 IIS APPPOOL\ASP.NET v4.0 7 IIS APPPOOL\ASP.NET v4.0 错误于 System.Web.UI.WebControls.FilteredDataSetHelper.GetDataTable(控制 所有者,对象数据对象)在 System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments 论据)在 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments 参数,DataSourceViewSelectCallback 回调)在 System.Web.UI.WebControls.DataBoundControl.PerformSelect() 在 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() 在 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() 在 System.Web.UI.Control.EnsureChildControls() 在 System.Web.UI.Control.PreRenderRecursiveInternal() 在 System.Web.UI.Control.PreRenderRecursiveInternal() 在 System.Web.UI.Control.PreRenderRecursiveInternal() 在 System.Web.UI.Page.ProcessRequestMain(布尔值 includeStagesBeforeAsyncPoint,布尔型 includeStagesAfterAsyncPoint)

我认为我的 IIS APPPOOL\ASP.NET v4.0 帐户有问题,实际上我在事件查看器上收到了 mssql 错误以及上述错误。

我所做的是按照http://msdn.microsoft.com/en-us/library/dd483479.aspx 的指示进行操作 与为该帐户创建授权脚本有关,并且 sql 错误消失了。问题是上面发布的错误仍在显示。关于为什么的任何线索?

我查看了 sql profiler 并得到了正在执行的存储过程

exec dbo.Starch_Display_Pivot @term=NULL

我在 SSMS 中运行它,我得到了预期的行,但在已发布的应用程序中,我没有得到任何行。有任何想法吗?

【问题讨论】:

  • 怎么会有人知道问题出在哪里?没有桌子。这表明您的查询没有返回任何行?这是因为查询吗?参数?使用的数据库?数据库中的数据?怎么会有人知道这些答案?
  • 此外,您的网络配置中有一个删除元素。那应该在那里吗?
  • @Charlie,我去掉了删除元素,但这并没有什么不同。我部署了两次应用程序并摆脱了第一次部署,因为它位于错误的文件夹中
  • 我看到了您的编辑,但仍然没有帮助。没有一般的“查询在 ASP.NET 中不返回任何行”的问题供任何人解决 - 您需要找出您的查询出了什么问题,或者为什么它在这种情况下不返回任何行。
  • 在 SSMS 中它返回所有行,在已发布的 Web 应用程序中返回 0。不知何故我错过了部署步骤,因此我的帖子

标签: .net asp.net sql-server-2008 iis


【解决方案1】:

我找到了我的解决方案。 “不包含任何表格”的例外情况有点误导。我复制了我的 Web 应用程序,然后创建了一个空网站。在调试时,我能够重新创建上面指出的异常,但在 catch 块中,它表明我的 defaultappPool 用户登录失败。我按照这里的指示http://selfelected.blogspot.com/2009/10/login-failed-for-user-iis.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-08
    • 2016-05-10
    • 2020-11-15
    • 1970-01-01
    相关资源
    最近更新 更多