Nested Repeater controls

liunx

Guest
I can't seem to get these nested repeater controls to work. When i run the page I only get blank page. Does anyone know th eproblem in my Code? It would help me a lot. thx

HTML CODE:

<asp:Repeater runat=server ID=rptProducts>
<ItemTemplate>
<asp:Label runat=server text=<%#DataBinder.Eval(Container.DataItem,"HeadDescription") %>></asp:Label><br />
<asp:Repeater runat=server ID=rptSub DataSource='<%# ((DataRowView)Container.DataItem).Row.GetChildRows("DescriptionRelation") %>'>
<ItemTemplate>
<asp:HyperLink runat=server NavigateUrl="shop.aspx" Text=<%#DataBinder.Eval(Container.DataItem, "description") %>></asp:HyperLink>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:Repeater>


C# CODE:



SqlConnection myCon2 = new SqlConnection(ConfigurationManager.AppSettings["sqlConnectionString"]);

#region MAIN TREE FILL


string SQLLog2 = "SELECT tbClassificationCaptions.clcap_fk_class_id, tbClassificationCaptions.clcap_caption as HeadDescription,";
SQLLog2 = SQLLog2 + " tbCatalogueSequences.cats_fc_class_parent, tbCatalogueSequences.cats_fk_cat_id, tbClassificationCaptions.clcap_fk_lang_id,";
SQLLog2 = SQLLog2 + " tbCatalogueSequences.cats_sequence, tbClassifications.class_temp FROM tbClassificationCaptions INNER JOIN tbCatalogueSequences ON";
SQLLog2 = SQLLog2 + " tbClassificationCaptions.clcap_fk_class_id = tbCatalogueSequences.cats_fk_class_id INNER JOIN tbClassifications ON tbClassificationCaptions.clcap_fk_class_id = tbClassifications.class_id WHERE (tbCatalogueSequences.cats_fc_class_parent = 0 AND (tbCatalogueSequences.cats_fk_cat_id = " + catID + "))";
SQLLog2 = SQLLog2 + " AND (tbClassificationCaptions.clcap_fk_lang_id = " + vLang + " AND (tbClassifications.class_temp = 0))";
SQLLog2 = SQLLog2 + " ORDER BY tbCatalogueSequences.cats_sequence";

SqlCommand myCommand2 = new SqlCommand(SQLLog2, myCon2);
SqlDataAdapter myAdapt2 = new SqlDataAdapter();
myAdapt2.SelectCommand = myCommand2;
DataSet ds = new DataSet();
myAdapt2.Fill(ds,"HeadDescription");

#region SUB TREE FILL

SQLLog2 = "SELECT tbClassificationCaptions.clcap_fk_class_id, tbClassificationCaptions.clcap_caption AS description,";
SQLLog2 = SQLLog2 + " tbCatalogueSequences.cats_fc_class_parent, tbCatalogueSequences.cats_fk_cat_id, tbClassificationCaptions.clcap_fk_lang_id,";
SQLLog2 = SQLLog2 + " tbCatalogueSequences.cats_sequence FROM tbClassificationCaptions INNER JOIN tbCatalogueSequences ON";
SQLLog2 = SQLLog2 + " tbClassificationCaptions.clcap_fk_class_id = tbCatalogueSequences.cats_fk_class_id WHERE (tbCatalogueSequences.cats_fc_class_parent = " + ds.Tables["HeadDescription"].Columns["clcap_fk_class_id"] + ") AND (tbCatalogueSequences.cats_fk_cat_id = " + catID + ")";
SQLLog2 = SQLLog2 + " AND (tbClassificationCaptions.clcap_fk_lang_id = " + vLang + ")";
SQLLog2 = SQLLog2 + " ORDER BY tbCatalogueSequences.cats_sequence";

myCommand2 = new SqlCommand(SQLLog2, myCon2);
myAdapt2.SelectCommand = myCommand2;
myAdapt2.Fill(ds, "description");

ds.Relations.Add("DescriptionRelation", ds.Tables["HeadDescription"].Columns["clcap_fk_class_id"], ds.Tables["description"].Columns["cats_fc_class_parent"]);

rptProducts.DataBind();


THX A MILWhat error are you getting?
 
Back
Top