[RESOLVED] XML and VB.NET
Hi there,
I have an XML file, which follows...
Code:
<countries>
<country>
<name>Italy</name>
<value>I</value>
</country>
<country>
<name>Japan</name>
<value>J</value>
</country>
<country>
<name>Germany</name>
<value>G</value>
</country>
<country>
<name>USA</name>
<value>U</value>
</country>
</countries>
Question: How do I populate my Drop Down List using VB.NET? I'd like to code it in the aspx.vb file. I wish to have an output like this...
Code:
<asp:DropDownList ID="drpCountry" runat="server">
<asp:ListItem Value="I">Italy</asp:ListItem>
<asp:ListItem Value="J">Japan</asp:ListItem>
<asp:ListItem Value="G">Germany</asp:ListItem>
<asp:ListItem Value="U">USA</asp:ListItem>
</asp:DropDownList>
Thanks in advance :D
Re: [RESOLVED] XML and VB.NET
Hi there,
Here's a question I have in mind, what are the practical uses of these kinds of XML files?
Re: [RESOLVED] XML and VB.NET
Quote:
Originally Posted by
Claude2005
Hi there,
Here's a question I have in mind, what are the practical uses of these kinds of XML files?
a lot of things,
create menus, store informations, database what ever you want
Re: [RESOLVED] XML and VB.NET
XML Files are typically used in a couple of specific situations. For instance,
1) You need to have a configuration file for your application that is both easy to navigate, but also easily human readable.
2) You need to exchange data between two systems, perhaps even across Operating System. XML format is easily understood by all systems.
3) You need a file to store some relational data, that doesn't warrant a full blown SQL Server instance.
But Claude, why the question, you seem to already be using XML, are you wanting to change the design?
Gary
Re: [RESOLVED] XML and VB.NET
Uhm, this will be the first time I'll be working with XML in ASP.NET. The purpose of this thread is just that I just want to expand my knowledge in programming. Right now, I can only formulate solutions basing on what I currently know. Knowing more stuff means I can formulate more efficient solutions.
Quote:
are you wanting to change the design?
I didn't understand what you meant here :)
Re: [RESOLVED] XML and VB.NET
Ah, fair enough, that makes sense.
Basically, I was asking whether you are happy with the current usage of your XML file, or are you looking to change it to something else?
Gary
Re: [RESOLVED] XML and VB.NET
Oh that one, it's just a simple XML to make me understand how to manipulate a XML file :D. Most of the tutorials I found teach you on how to manipulate the XML file but they don't show the XML file so I really can't absorb anything they teach.
Re: [RESOLVED] XML and VB.NET
Ah, I see. I thought this was a file that you were already using in your application, i.e. you had already decided to use XML. That makes more sense.
It really comes down to how much data you have, what you are going to be doing with it, etc, all of these things will influence the decision about which data format to use.
Gary
Re: [RESOLVED] XML and VB.NET
Yep. I guess that sums it all up. I'll post questions here in case I encountered some.
Thanks guys, I appreciate it :D