Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Loading XML into a property/member of class?
Message
From
17/03/2010 08:55:17
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01454941
Message ID:
01455056
Views:
27
>>>Hi,
>>>
>>>What type of property or member in a class I should/could use to populate values from and XML file of the following (sample) content:
>>>
>>>
>>><?xml version="1.0" encoding="utf-8" ?>
>>><rules>
>>>	<field>
>>>		<fld_name>ColumnName1</fld_name>
>>>		<def_value></def_value>
>>>		<req_entry>True</req_entry>
>>>	</field>
>>>	<field>
>>>		<fld_name>ColumnName2</fld_name>
>>>		<def_value></def_value>
>>>		<req_entry>False</req_entry>
>>>	</field>	
>>></rules>	
>>>
>>>
>>>I should be able to later to scan through the values of this member (array or list or whatever) checking the values.
>>>
>>>TIA.
>>>
>>>Update: Just as I posted this message I thought about loading this XML into a dataset member of the class. Unless someone suggests a better approach, I think I will go with a dataset.
>>
>>Probably I didn't understand your question. I would simply use Linq to XML.
>>Cetin
>
>Isn't Linq (I admit I know nothing about it) is for loading from a database?

No. In very short and informal definition Linq is about querying (and of course update/delete/insert where applicable) anything that can be enumerated (be it a files list on disk, an array, processes, data from a remote table, datatable, list, whatever you can use a plural form:) It stands for LanguageINtegratedQuery. You can find more details and samples in my blog.

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform