473,796 Members | 2,482 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reads XML node from App.Config and populates a Class

PH
Hi guys;

I got the following problem to solve, hope you can help me.

I got a XML node in App.Conf;
<CUSTOMERS>
<CUSTOMER>
<NAME =”Frank” />
<LASTNAME =”Smith”/>
<AGE= 34 />
</CUSTOMER>

<CUSTOMER>
<NAME =”Lisa” />
<LASTNAME =”Tucker”/>
<AGE= 42 />
</CUSTOMER>
<CUSTOMERS/>

I will like to populate a class called Customers that has the same
structure than the XML node Customers, with all the Customer nodes.
Is there any automated way to do this in the framework?

Thanks very much

Mar 9 '06 #1
2 1093
In a word, XMLSerializatio n.

Mar 9 '06 #2
PH

This is what I need.
Thanks
-----Original Message-----
From: za***@construct ion-imaging.com
[mailto:za***@co nstruction-imaging.com]
Posted At: Thursday, March 09, 2006 12:18 PM
Posted To: microsoft.publi c.dotnet.langua ges.vb
Conversation: Reads XML node from App.Config and populates a Class
Subject: Re: Reads XML node from App.Config and populates a Class

In a word, XMLSerializatio n.

Mar 9 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
7691
by: Keith M | last post by:
Hi, I have found a very useful piece of code in the msdn which shows how to load an xml config file, search for a particular value and replace it. Could someone possibly convert it to C# from the VB I have? I also would like to use similar code to update the machine.config file so if someone could explain how to add a node ("appSettings") if node not found and also how to add a key value pair into the "appSettings" node if found I would...
4
1800
by: Grant | last post by:
Gday, I am using the sample code at: http://support.microsoft.com/default.aspx?scid=kb;en-us;317666 to modify an existing XML document. The XML document looks like the following: --------------------------- <parameters> <Config-File> <Value>c:\config.xml</Value>
16
1996
by: Timm | last post by:
I'm trying to use ASP objects (basically formed and populated based on Web.Config settings) and I want to use them in a different non-asp program with minimal reprogramming. So, my question is how do I mock up what ASP does to read the Web.Config file? I've tried messing around in the System.Configuration library and haven't been able to find anything from taking a quick look at the objects and their methods (for the goal of populating the...
6
3249
by: PH | last post by:
Hi guys; I got the following problem to solve, hope you can help me. I got a XML node in App.Conf;
0
9680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10455
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10173
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10006
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.