frustuated dataset problem....

alanchinese

Well-known member
Joined
Jan 12, 2005
Messages
58
ok i think this is one thing really simple!! but all i tried to look for articles from the web, or looking at the xml books in borders didnt give me the working solution.

let me describe the simplied requirement here.

* a tennis tournament has 5 different errands, (men, women, mens double, womens doulbe, mixed double)
* each level has exactly 8 players in the beginning, plays exactly 7 elimination matches (3 rounds only)
* each match has 3 pieces of data (player/team1, player/team2, match number)

i believe its a ((master -> detail) -> detail) -> detail relationship.
i am sure i can understand how to design the schema if i read a 500 page xml book page by page. but i am so frustuated now, i cant read anything into my mind.

all i want to do is, use VS.Net to design the dataset xsd, use the function DataSet.ReadXml("file.xml") to load the data into the dataset.
create the UI for read/update the match data on each errands with brackets using textboxes.
bound the dataset with the textboxes....

is it do-able?? and how to do it?
 
Id do it like this:

Tables
-----------
Errands(ErrandID, ErrandDesc)
Players(PlayerID, PlayerName)
Matches(MatchID, ErrandID, PlayerID_1, PlayerID_2)


Relations
------------
Errands.ErrandID -> Matches.ErrandID
Players.PlayerID -> Matches.PlayerID_1
Players.PlayerID -> Matches.PlayerID_2
 
alright... thankx a lot!
the harder part is how to bind the data to the controls.
let me simplify the problem even more!
the file, "file.xml" is like the following.

<tournament>
<errand>
<name>Mens Single</name>

<match>
<id>0</id>
<player1>Alan</player1>
<player2>Andy</player2>
</match>

<match>
<id>1</id>
<player1>Barry</player1>
<player2>Baron</player2>
</match>

</errand>
<errand>
<name>Womens Single</name>

<match>
<id>3</id>
<player1>Caren</player1>
<player2>Carol</player2>
</match>

<match>
<id>4</id>
<player1>Donna</player1>
<player2>Denise</player2>
</match>

</errand>
</tournament>

(note: the new rule, there are only two matches in each errand and both of them need to be listed on the form, not in the datagrid)

now i have
* some controls to help me to navigate the binding context, from mens single to womens single, and more.
on the panel of each errand, there are
* one textbox, the name of the errand
* two "match" control in the form, each control holds the id, player1, and player2 textboxex.

how can i set up the databinding?
 
alright, within the master-detail schema, i found out how to build two tables and relation to bound the controls.
however, the detail has to be a datagrid! if there are only fixed two rows in the detail table, is it possible for me to bind the data into two set of textboxes for each row? i can bind one set of the textboxes, and changing the binding context position to browse through the data. but since there are two rows only, i want to display two set of textboxes and withdrow the binding context for the detail table.
any help is HUGE for this problem which kill billions of my brain cell.
thankx a lot.
 
Back
Top