Bug reports Found a bug? Post it here please.
Version 4.x > Bug reports > XML Data Source unable to handle empty result set View modes: 
User avatar
Member
Member
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

User avatar
Kentico Developer
Kentico Developer
kentico_zbysekn - 5/25/2009 7:04:02 AM
   
RE:XML Data Source unable to handle empty result set
Hi Richard,
we have identified this as bug. It will be fixed in next version.
Thank you for this valuable information.

Best Regards,
Zbysek Nemec.

User avatar
Member
Member
vin4.net-gmail - 7/9/2012 9:35:01 AM
   
RE:XML Data Source unable to handle empty result set
Hi am facing problem in specifying the table name in the XML data source repeater.

I am trying read a xml file by spacing it in a folder under my project root. Added XML data source repeater on the page, specified the file path and added a basic repeater with data source control id and transformation for fetching data from the xml file.

But its not showing any data. I guess, need to specify the table name but I am not getting how to find out the table name.

Please help me to achieve this.

Thanks in advance.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 7/11/2012 11:26:10 AM
   
RE:XML Data Source unable to handle empty result set
This topic continue in this thread

Best regards,
Ivana Tomanickova