• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Visual Studio noob questions

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

Twigglish

Member
Joined
Jul 23, 2007
Location
Clarksville, TN
I have an XML sheet with about 15 columns and 3K rows of information. At its most basic I want to create a program that has search boxes that are linked to specific columns on the XML sheet.

I'm able to create a project, add a DataSet, add DataTables and columns to those tables. I don't know how to bring my XML sheet in and actually use it.

It seems so basic that searching some of the keywords should leave me without question as to how to do this. Every thing I bring up, gets really confusing at one point or another so I look at another way. And every single way seems completely different. Help?
 
Try searching for "C# XML parser" or "VB XML parser," depending on the language you're using. There are already some libraries out there that should make your life a lot easier than trying to roll your own. There should be a good amount of documentation on any packages you find.
 
Create an object that stores a single entry's values. Read in the XML, line at a time, into individual objects. Store the objects in a list, or use something else depending on your needs. From there, you can do simple LINQ commands to search and sort the objects.
 
It makes sense when you get it down, and it is incredibly powerful. Sorting and searching lists is pretty simple.

Code:
Sorts the list, returning objects sorted from smallest to biggest, comparing the "Order" field.
SortedLiteralList.Sort((Lit1, Lit2) => Lit1.Order.CompareTo(Lit2.Order));
 
Back