This is a migrated thread and some comments may be shown as answers.

Tree view drag drop changes parent ID in Database

0 Answers 71 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
umar
Top achievements
Rank 1
umar asked on 17 Jan 2011, 06:05 AM
i am using treeview and gets parent id from database..if i will drop node to another parent it should change its parent id in database also..Plz share your views..
SqllConnection con = new SqlConnection("Server=HUZAIF-PC;Database=ShoppingOnline;Integrated Security=True");
        SqlCommand cmd = new SqlCommand("SELECT * FROM product_table",con);
        SqlDataAdapter da = new SqlDataAdapter(cmd);
       // da.SelectCommand.Parameters.Add("@parentID", SqlDbType.VarChar, 50).Value = parentID;
        DataTable links = new DataTable();
        da.Fill(links);
        treeView.DataTextField = "product_Name";
        treeView.DataFieldID = "product_ID";
        treeView.DataFieldParentID = "parent_ID";
        treeView.DataValueField  = "product_ID";
        treeView.DataSource = links;
        treeView.DataBind()

No answers yet. Maybe you can help?

Tags
TreeView
Asked by
umar
Top achievements
Rank 1
Share this question
or