المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : C# and .Net, trying to select a list of classes from name of node in xml file



C# Programming
08-05-2012, 09:11 PM
Hi, i have a little bit of a problem using xml and mysql in c#. let me show you how this works:

This is how my program works,

this is a treeview that you select a node from

|--------------------|
| -FirstNode
|__+FirstChild
|__+SecondChild
|__+ThirdChild
| -SecondNode
|__+FirstChild
|__+SecondChild
|__+ThirdChild
|--------------------|

and in this datagridview it will show data from the database, based on what treeview node you select.

|-------------------------------|
|Year|Class|Open|Locked|
|-----|--------|------|---------|
|-----|--------|------|---------|
|-----|--------|------|---------|
|-----|--------|------|---------|
|-----|--------|------|---------|
|-----|--------|------|---------|
|-----|--------|------|---------|
|-------------------------------|

And the database is built like this:

there are databases (named after the two root nodes in the xml treeview),

FirstNode
SecondNode


Under these databases is the information i want into the datagridview.

and now to the problem, i can't select one of the child nodes without getting information from both of the nodes.

as in example, if i press the first node. everything in the database FirstNode is posted into the datagridview as i want, and that goes to the same for SecondNode. But when i press one of the child nodes i get the information from both of the cilds in both roots. is there a way to make them unique so i can get the correct information from only one of the child nodes? i can post code if that would help you.
Thanks, from Perry http://www.barakasoft.com/script/Forums/Images/smiley_wink.gif