Note that there are some explanatory texts on larger screens.

plurals
  1. POSystem.ArgumentException: The relation is not parented to the table to which this DataView points
    primarykey
    data
    text
    <p>I have following requirements, 1. Need to show distinct apName. 2. For every apName, show rates.</p> <p>I have tried this so far,</p> <p>on .cs page</p> <pre><code>protected void btn_ViewClick(object sender, EventArgs e) { //bind the repeater control, with the Data Table rptApartmentName.DataSource = rate.GetAllApartmentRates(); rptApartmentName.DataBind(); } private void rptApartmentName_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e) { RepeaterItem item = e.Item; if ((item.ItemType == ListItemType.Item) || (item.ItemType == ListItemType.AlternatingItem)) { Repeater rptRates = (Repeater)item.FindControl("rptRates"); DataRowView drv = (DataRowView)item.DataItem; rptRates.DataSource = drv.CreateChildView("apartment_rate"); rptRates.DataBind(); } } </code></pre> <p>and on aspx page,</p> <pre><code>&lt;!-- start parent repeater --&gt; &lt;asp:repeater id="rptApartmentName" runat="server" OnItemDataBound="rptApartmentName_ItemDataBound"&gt; &lt;itemtemplate&gt; &lt;b&gt;&lt;%# DataBinder.Eval(Container.DataItem,"apName") %&gt;&lt;/b&gt;&lt;br&gt; &lt;!-- start child repeater --&gt; &lt;asp:repeater id="rptRates" runat="server"&gt; &lt;itemtemplate&gt; &lt;%# DataBinder.Eval(Container.DataItem, "rate")%&gt;&lt;br&gt; &lt;/itemtemplate&gt; &lt;/asp:repeater&gt; &lt;!-- end child repeater --&gt; &lt;/itemtemplate&gt; &lt;/asp:repeater&gt; &lt;!-- end parent repeater --&gt; </code></pre> <p>please somebody suggest, what is wrong with this code, thanks in advance. I am using Asp.Net 2010.</p> <p>Stack Trace:</p> <pre><code>Line 96: Repeater rptRates = (Repeater)item.FindControl("rptRates"); Line 97: DataRowView drv = (DataRowView)item.DataItem; Line 98: rptRates.DataSource = drv.CreateChildView("apartment_rate"); Line 99: rptRates.DataBind(); Line 100: } </code></pre> <p>I have got error on line 98, as System.ArgumentException: The relation is not parented to the table to which this DataView points.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload