Skip to content

Two category main categories and sub categories,

suhail (Hacki)

Asked Sep 23, 2017, 2:52 AM EDT1 answer
Share
LinkedInX
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..
 
Java
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
Code
        {
          obj_html.Append ( "" + ds.Tables[0].Rows[i]["Title"].ToString() +  " ");
        }

        return obj_html.ToString();

    }

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    PLz help how i correct it displaying data under category by using category id
    0