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 ( "" + ds.Tables[0].Rows[i]["Title"].ToString() + " ");
}
return obj_html.ToString();
}
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
suhail (Hacki)Posted Sep 23, 2017, 7:04 AM