Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 didn't give me the working solution.

 

let me describe the simplied requirement here.

 

* a tennis tournament has 5 different errands, (men, women, men's double, women's 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 it's 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 can't 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?

Posted

I'd 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

Posted

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>Men's 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>Women's 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 men's single to women's 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?

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...