2011-09-16 159 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