Take the 2-minute tour ×

New to the community, but here is my first question that I am stuck on. I am new to WPF and WebClient using C# and I am attempting to make a program that access www.nba.com to populate a combobox I have with team names, and then when a user selects a team from the combobox, I wanted to populate a portion of the main window with the roster from the teams home site, same style and eveything. I was able to populate the combobox using the WebClient.OpenRead and reading in the markup to extract the team names.

Now I am on the more difficult part. I was planning on using the same method to grab all the markup and then somehow display the table in a content panel, but I feel that this is a very tedious thing to do. Can anyone give me any tips for completing this action or is there a method in the webclient class that allows me to search a webpage for a table or object other than text? Thanks.

share|improve this question
IMO, you should not dynamically fetch a decidedly static list of NBA team names. –  Kirk Woll May 31 '12 at 22:34
That is true, I forgot to mention that I am doing this for practice with a new technology to me, so my reasoning was that if I could populate the list, I could use that knowledge in retrieving the roster info –  Jordan Brooker May 31 '12 at 22:40
that's fair enough. –  Kirk Woll May 31 '12 at 22:42

1 Answer 1

up vote 2 down vote accepted

Have a look at the HTML Agility Pack to make parsing the HTML easier. You'll also want to abstract the data access using a repository pattern so that your client doesn't need to change when the HTML changes, and so that adding caching is more straightforward.

share|improve this answer
perfect, this a great resource for me to look into, thanks for the quick response! –  Jordan Brooker May 31 '12 at 22:51

Your Answer


