suhail (Hacki)

suhail (Hacki)

  • NA
  • 34
  • 514

two category main categories and sub categories,

Sep 23 2017 6:52 AM
i want to display sub category into main category but here is problem of main category id ,how can it retrived into sub category please help me..
 
public partial class _Default : System.Web.UI.Page
{
protected CategoryManager obj;
protected SubCategoryManager obj2;
protected void Page_Load(object sender, EventArgs e)
{
obj = new CategoryManager();
obj2 = new SubCategoryManager();
Ltrmenu.Text = Menulinks();
// DataSet ds2 = obj2.AllSubCategories();
// //lbl.Text = ds2.Tables["Categories"].Rows[0]["Title"].ToString();
////lbl.Text =ds2.Tables[0].Rows[0]["Title"].GetParentRow["categoryid"].ToString();
// lbl.Text=ds2.Relations.Add(ds2.Tables["AllCategories"].Columns["Categoryid"],ds2.Tables[0].Rows[0]["Title"]);
}
public string Menulinks()
{
StringBuilder obj_html = new StringBuilder();
DataSet ds = obj.AllCategories();
DataSet ds2 = obj2.AllSubCategories();
lbl.Text = ds2.Tables[0].Rows[0]["Title"].ToString();
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
obj_html.Append ( "<li>" + ds.Tables[0].Rows[i]["Title"].ToString() + " </li>");
}
return obj_html.ToString();
}
 

Answers (1)