Adding Parent and Child Nodes in TreeView from Sql Server 2008
问题 i want to add the parent and child nodes from sql server to treeview. i implemented some code. but i gets error "Index was out of range" below is the code i am using to fill parent and child nodes. protected void GetParentNodes() { SqlDataAdapter adap = new SqlDataAdapter("select id, name from crossarticle_category where parentid=-1", con); DataTable dt = new DataTable(); adap.Fill(dt); int index = -1; foreach (DataRow d in dt.Rows) { SqlDataAdapter adapInner = new SqlDataAdapter("select id,