Advertisement

04.29.2008 at 07:22PM PDT, ID: 23364242
[x]
Attachment Details

Treeview Binding to SQL problem

Asked by jnsimex in C# Programming Language, Miscellaneous Programming, Visual Studio .NET 2005

I am trying to bind the Treeview to an SQL Database. As you can see in the image, it is not working.

I need to append all the items that have the same assembly or subassembly.

How do I accomplish this with the coding provided?Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
TreeNode rootNode = new TreeNode(this.Project.Name);
 
 
            treeView1.Nodes.Add(rootNode);
 
 
 
            foreach (AccpacBOMDataSet.BOMRow bomRow in bomTable.Rows)
            {
                if (bomRow.AssemblyName != null)
                {
                    TreeNode assemblyNode = new TreeNode();
                    assemblyNode.Text = bomRow.AssemblyName;
                    rootNode.Nodes.Add(assemblyNode);
 
                    if (!bomRow.IsSubAssemblyNameNull())
                    {
                        TreeNode subAssembly = new TreeNode();
                        subAssembly.Text = bomRow.SubAssemblyName;
                        assemblyNode.Nodes.Add(subAssembly);
 
                        if (!bomRow.IsSubAssembly1NameNull())
                        {
                            TreeNode subAssembly1 = new TreeNode();
                            subAssembly1.Text = bomRow.SubAssembly1Name;
                            subAssembly.Nodes.Add(subAssembly1);
 
                            if (bomRow.ItemNo != null)
                            {
                                TreeNode itemNo = new TreeNode();
                                itemNo.Text = bomRow.ItemNo;
                                subAssembly1.Nodes.Add(itemNo);
                            }
 
                        }
                        else
                        {
                                TreeNode itemNo = new TreeNode();
                                itemNo.Text = bomRow.ItemNo;
                                subAssembly.Nodes.Add(itemNo);
                        }
                    }
                    else
                    {
                        TreeNode itemNo = new TreeNode();
                        itemNo.Text = bomRow.ItemNo;
                        assemblyNode.Nodes.Add(itemNo);
                    }
 
                }
            }
        }
Attachments:
 
Treeview with Database
Treeview with Database
 
[+][-]05.01.2008 at 08:43AM PDT, ID: 21479711

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.01.2008 at 06:03PM PDT, ID: 21483900

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.03.2008 at 05:33PM PDT, ID: 21494206

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 04:48PM PDT, ID: 21503872

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 09:25PM PDT, ID: 21504750

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.07.2008 at 03:17PM PDT, ID: 21520833

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.07.2008 at 03:20PM PDT, ID: 21520854

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.07.2008 at 03:33PM PDT, ID: 21520932

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.10.2008 at 08:37AM PDT, ID: 21539396

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.10.2008 at 09:22AM PDT, ID: 21539524

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.10.2008 at 09:34AM PDT, ID: 21539571

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.10.2008 at 06:34PM PDT, ID: 21541195

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.10.2008 at 07:22PM PDT, ID: 21541264

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.10.2008 at 07:35PM PDT, ID: 21541293

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: C# Programming Language, Miscellaneous Programming, Visual Studio .NET 2005
Sign Up Now!
Solution Provided By: JimBrandley
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.10.2008 at 08:07PM PDT, ID: 21541345

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.10.2008 at 08:55PM PDT, ID: 21541418

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628