2011-09-16 161 views
1

我有一个Web应用程序运行在VS 2010,SQL Server 2008和Windows 7上ASP.NET发布错误

它在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.DataSourceView(控制 所有者,对象dataObject时)在 System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments 参数)。在在 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() System.Web.UI.WebControls.DataBoundControl.PerformSelect()在 System.Web.UI.WebControls.CompositeDataBoundControl选择(DataSourceSelectArguments 参数,DataSourceViewSelectCallback回调) .CreateChildControls() at System.Web.UI.Control.EnsureChildControls()at System.Web.UI.Control.PreRenderRecursiveInternal ()在 System.Web.UI.Control.PreRenderRecursiveInternal()在 System.Web.UI.Control.PreRenderRecursiveInternal()在 System.Web.UI.Page.ProcessRequestMain(布尔 includeStagesBeforeAsyncPoint,布尔includeStagesAfterAsyncPoint)

/MagazineFormatUpdater/default.aspx :: 1假IIS APPPOOL \ ASP.NET v4.0的7 IIS APPPOOL \ ASP.NET v4.0的虚假在 System.Web.UI.WebControls.FilteredDataSetHelper.GetDataTable(控制 所有者,对象dataObject)在 System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments argume NTS)处 System.Web.UI.WebControls.DataBoundControl.PerformSelect()在 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound( System.Web.UI.DataSourceView.Select(DataSourceSelectArguments 参数,DataSourceViewSelectCallback回调) )at System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() at System.Web.UI.Control.EnsureChildControls()at System.Web.UI.Control.PreRenderRecursiveInternal()at 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事件探查一下,并得到执行

exec dbo.Starch_Display_Pivot @term=NULL 

存储的过程我跑这里面SSMS和我预期的行,但已发布的应用程序里面,我越来越没有行。有任何想法吗?

+0

怎么可能有人可能知道问题是什么?没有表格。这表明你的查询没有返回任何行?这是因为查询?参数?数据库使用?数据库中的数据?任何人都可能知道这些答案? –

+0

此外,您的网页配置中还有一个删除元素。应该在那里吗? –

+0

@John,只做了一个修改。 – Jeff

回答

0

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