Avatar of PsiJet
PsiJet asked on

Datagridview + HTML Tables (Visual Basic 2010 / VS 2010)

Okay, so I am baffled on this part and I don't know why (maybe because I had read through so many tutorials/threads in regards to this and confused myself).

I am trying to basically import a HTML page table (remotely accessed through a URL) to a Datagridview. I can view it as a pipe delimited.

Here is the HTML/pipe delimited: http://www.magictraders.com/cgi-bin/set_query.cgi?set=ABU&excel=true

So a rundown would be:

1. Import that information to a datagridview (DataGridView1)
2. Make sure all data is put into the appropriate column.

I know it's probably something super simple, but for some odd reason, as I stated above, the answer eludes me.
.NET ProgrammingHTMLVisual Basic.NET

Avatar of undefined
Last Comment
Vaughn Bigham

8/22/2022 - Mon
Bob Learned

What kind of help are you looking for?

I can think of things like this:

1) Microsoft.VisualBasic.FileIO.TextFieldParser

2) Build a list of objects

3) Bind the list to the DataGridView

4) Set the DataPropertyName to each object property

Well I need to parse that data from the site above, taking out the information and then putting into a datagridview.

With a datagridview with the following headers:

Card Name | Rarity | High Price | Mid Price | Low Price

Using the example above:

Air Elemental (A)|3.25|0.00|3.25|3.25|3.25|0.00|1
Air Elemental (B)|4.97|0.02|4.97|4.99|4.95|0.00|2
Air Elemental (U)|7.00|0.00|7.00|7.00|7.00|0.00|1
Ancestral Recall (A)|697.77|0.00|697.77|697.77|697.77|0.00|1

The parts marked in bold are the parts that I want to parse into the columns. Would the TextFieldParser work for this? Either way I'll give it a try and update here.
Bob Learned

The TextFieldParser can use the pipe as a delimiter, and since the first row has names, you should be able to match up the values to object names, and build a list that you can bind to the DataGridView.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Vaughn Bigham

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

Could you please provide an example? I'm a visual person. It doesn't need to be full code, but examples have always helped (especially since I've never used TextFieldParser).

vbigham: The only site I know of is through that site and they only do core sets and some expert sets (albeit the unglued/unhinged which I classify as special sets). The only other one that I know of uses a webservice, which I had issues with dealing with for some odd reason, but that's just me and my coding skills. LOL

I will check out your code and see what I can do with it. I thank you for the time! :)

Oh, vbigham:

You can use it if you view the source code on that websites main page and click on Price Guides. Since I've seen so many abbreviations for the sets:

Fifth Dawn - 5DN
Mirrodin - MRD

Just FYI. :)
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.

(Stupid non-editing feature):

Okay, I re-read what you said and there are a LOT of sets.

Core Sets there are: Alpha, Beta, Unlimited, Revised, 4th-10th Edition, M10, M11 (from the site that I gave, abbreviations are: ABU, RV, 4th, 5th, 6th (etc to 10th), M10 and M11

Expert: To many to list, but the newest sets are Scars of Mirrodin, Mirrodin Besieged and New Phyrexia

Again, you can look at the source code from: http://www.magictraders.com/pricelists/

You'll see them in the Drop Down List.
Vaughn Bigham

Awesome! thanks for that info.