richard.pendergast-notatallstrange
-
5/20/2009 7:09:33 PM
XML Data Source unable to handle empty result set
When an XML Data Source is used and an empty XML result set is returned, any basic repeater attached to the XML Data Source will throw an exception.
We are using Kentico Version: 4.0 Build: 4.0.3328 and in this case no custom code.
For example, if the following result set is returned to an XML Data Source:
<?xml version="1.0" encoding="utf-8"?><SEARCHRESULTS></SEARCHRESULTS>
then any Basic Repeater attached will throw the following exception:
Server Error in '/' Application. -------------------------------------------------------------------------------- Cannot find table 0. 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.IndexOutOfRangeException: Cannot find table 0. Source Error: Line 384: { Line 385: // Set transformations if data source is not empty Line 386: if ((!RequestHelper.IsPostBack()) && (this.DataSourceControl != null) && (!DataHelper.DataSourceIsEmpty(this.DataSourceControl.DataSource)) && (!binded)) Line 387: { Line 388: LoadTransformations(); Source File: e:\KenticoCMS4\CMSWebParts\Viewers\BasicRepeater.ascx.cs Line: 386 Stack Trace: [IndexOutOfRangeException: Cannot find table 0.] System.Data.DataTableCollection.get_Item(Int32 index) +92 CMS.Controls.XMLDataSource.GetDataSourceFromDB() +138 CMS.Controls.CMSBaseDataSource.GetDataSource() +320 CMS.Controls.XMLDataSource.get_DataSource() +5 CMSWebParts_Viewers_BasicRepeater.OnPreRender(EventArgs e) in e:\KenticoCMS4\CMSWebParts\Viewers\BasicRepeater.ascx.cs:386 System.Web.UI.Control.PreRenderRecursiveInternal() +80 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082
|