/// <summary> /// LoadLeftMenu /// </summary> private void LoadLeftMenu() { CommonDb db = new CommonDb(); //Create the connection and DataAdapter for the Authors table. SqlConnection cnn = db.OpenConnection(); SqlDataAdapter cmd1 = new SqlDataAdapter("select * from Category", cnn); //Create and fill the DataSet. DataSet ds = new DataSet(); cmd1.Fill(ds, "Category"); //Create a second DataAdapter for the Titles table. SqlDataAdapter cmd2 = new SqlDataAdapter("select * from SubCategory", cnn); cmd2.Fill(ds, "SubCategory"); //Create the relation bewtween the Authors and Titles tables. ds.Relations.Add("myrelation", ds.Tables["Category"].Columns["CategoryId"], ds.Tables["SubCategory"].Columns["CategoryId"]); ds.Relations[0].Nested = true; //Bind the Authors table to the parent Repeater control, and call DataBind. parentRepeater.DataSource = ds.Tables[0]; parentRepeater.DataBind(); }