Adding to XML File using LINQ and C#


Server Intellect


Adding to XML File using LINQ and C#

This tutorial was created with Visual Studio 2008, but can be replicated in 2005 if you download and install Microsoft's LINQ Community Technology Preview release, which can be downloaded from here.

We moved our web sites to Server Intellect and have found them to be incredibly professional. Their setup is very easy and we were up and running in no time.

LINQ has the amazing ability to communicate and interact with many various data sources - databases, XML and varying objects. In this tutorial, we will be using a Windows Form to look at how we can use LINQ to add data to an XML file for storage. This is a quick and easy alternative to using a database. An XML file would be good for storing less information, which is not sensitive.

The XML file we will be using in this example is as follows:

<?xml version="1.0" encoding="utf-8" ?>
<Persons>
<Person>
<Name>Paxton</Name>
<City>Munich</City>
<Age>29</Age>
</Person>
<Person>
<Name>Mike</Name>
<City>Orlando</City>
<Age>33</Age>
</Person>
<Person>
<Name>Ella</Name>
<City>LA</City>
<Age>13</Age>
</Person>
<Person>
<Name>Ingrid</Name>
<City>Oslo</City>
<Age>63</Age>
</Person>
</Persons>

We will create a Windows Form to view the XML file, and also to add new data to it. We will add three textboxes to the form - for name, city and age; two buttons - for adding and viewing XML data; and a Rich Text Box for viewing the XML data. We can also add labels to the text boxes.

Once our form is ready, we can move to the code-behind and add the namespaces we are going to use. The majority of which are added automatically. We may need to add System.Xml.Linq, however. It will look something like this:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml.Linq;

Need help with Windows Dedicated Hosting? Try Server Intellect. I'm a happy customer!

Once we have added our references, we will create an on-click handler for the view button. We will add the following code-behind:

private void button1_Click(object sender, EventArgs e)
{
XDocument xmlDoc = XDocument.Load("People.xml");

var persons = from person in xmlDoc.Descendants("Person")
select new
{
Name = person.Element("Name").Value,
City = person.Element("City").Value,
Age = person.Element("Age").Value,
};

txtResults.Text = "";
foreach (var person in persons)
{
txtResults.Text = txtResults.Text + "Name: " + person.Name + "\n";
txtResults.Text = txtResults.Text + "City: " + person.City + "\n";
txtResults.Text = txtResults.Text + "Age: " + person.Age + "\n\n";
}

if (txtResults.Text == "")
txtResults.Text = "No Results.";
}

This code-block utilizes LINQ, first loading the XML file into memory, and then selecting all the data from within. The LINQ query looks similar to a SQL statement. We select all data from the XML file and then loop through this data, outputting all results into the text box. Finally, we check to see if the XML file is empty.

Next, we will add the code for the button to add new data to the XML file. We create another handler for the other button:

private void button2_Click(object sender, EventArgs e)
{
XDocument xmlDoc = XDocument.Load("People.xml");

xmlDoc.Element("Persons").Add(new XElement("Person", new XElement("Name", txtName.Text),
new XElement("City", txtCity.Text), new XElement("Age", txtAge.Text)));

xmlDoc.Save("People.xml");
}

I just signed up at Server Intellect and couldn't be more pleased with my Windows Server! Check it out and see for yourself.

Similar to the other button, this one also opens the XML file, to enable us to edit it. We then simply add an element to the XML file, into the Persons element.
Now our Window Form can both read and write to the XML file. The entire code-behind looks something like this:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml.Linq;

namespace LINQtoXML_cs
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
XDocument xmlDoc = XDocument.Load("People.xml");

var persons = from person in xmlDoc.Descendants("Person")
select new
{
Name = person.Element("Name").Value,
City = person.Element("City").Value,
Age = person.Element("Age").Value,
};

txtResults.Text = "";
foreach (var person in persons)
{
txtResults.Text = txtResults.Text + "Name: " + person.Name + "\n";
txtResults.Text = txtResults.Text + "City: " + person.City + "\n";
txtResults.Text = txtResults.Text + "Age: " + person.Age + "\n\n";
}

if (txtResults.Text == "")
txtResults.Text = "No Results.";
}

private void button2_Click(object sender, EventArgs e)
{
XDocument xmlDoc = XDocument.Load("People.xml");

xmlDoc.Element("Persons").Add(new XElement("Person", new XElement("Name", txtName.Text),
new XElement("City", txtCity.Text), new XElement("Age", txtAge.Text)));

xmlDoc.Save("People.xml");
}
}
}

Server Intellect offers Windows Hosting Dedicated Servers at affordable prices. I'm very pleased!

Download Project Source - Enter your Email to be emailed a link to download the Full Source Project used in this Tutorial!



100% SPAM FREE! We will never sell or rent your email address!
 


Comments
bill said:

how would you handle the situation where the people.xml didn't exist yet.

say the first time through. how would you create the xml file. i have done it before with xmldocument but not with tthe new linq stuff.

Posted 11/05/2008 at 7:34 AM
Jit4peace said:

If you want to handle the people.xml which is not created yet, you just need to create XDocument, store xml data in it, and save it calling xmlDoc.Save("FileName").

Hope this works fine for you,,,,

Regards,

Jit

Posted 06/03/2009 at 10:34 PM
dhivya said:

How to add reference(system.xml.Linq)?

Posted 06/26/2009 at 2:14 AM
top gambling bonuses and offers said:

This article explains how to create and save an xml file, and then how to bind it to a treeview, but I think it falls far short of what the title promises. The xml is populated using hardcoded urls. (Which would be totally fine for an example that wasn't titled "Creating an ASP.NET SiteMap dynamically..."I would have expected that this should contain a routine that accepts a starting url and then traverses the website and picks up the website hierarchy "dynamically" and construct the xml accordingly.

Posted 06/29/2009 at 5:50 AM
Zdenek said:

Thanks, this article is so easy, I do understand that too :)

Posted 11/06/2009 at 5:25 AM
Nathan for Austin said:

This is easily the best article I've found on XML in C# after days of searching, period. Thanks for the clear example.

Posted 11/12/2009 at 2:45 PM
rockey said:

how to add an element to xml using c#

Posted 11/26/2009 at 11:04 PM
rockey said:

Thanks! dis article is very use full for me to clear my doubt....Once Again Thanks a lot.....

Posted 11/26/2009 at 11:05 PM
juego poker gratis said:

how would you create the xml file. i have done it before with xmldocument but not with tthe new linq stuff.

Posted 11/27/2009 at 11:18 AM
como jugar poker said:

SQL and LINQ to Objects. In this article, we will be looking at LINQ to XML in Visual Studio.NET 2008. If you do not have 2008, you can download the LINQ Preview for VS.NET 2005 direct from Microsoft.

Posted 12/03/2009 at 9:02 AM
find people now said:

that this should contain a routine that accepts a starting url and then traverses the website and picks up the website hierarchy "dynamically" and construct the xml accordingly.

Posted 12/08/2009 at 1:27 AM
Commercial Car Hire said:

the first time through. how would you create the xml file. i have done it before with xmldocument but not with tthe new linq stuff.

Posted 02/18/2010 at 10:43 AM
SEO said:

hand by offering the 20 Greatest Albums Of 2009 ... So Far. If you remember, the list wasn't in any specific order. Their 40

Posted 03/16/2010 at 11:31 AM
Houston DWI Lawyer said:

for adding and viewing XML data; and a Rich Text Box for viewing the XML data. We can also add labels to the text boxes.

Posted 03/19/2010 at 2:55 AM
how to build solar panels said:

we can move to the code-behind and add the namespaces we are going to use. The majority of which are added automatically. We may need to add System.Xml.Linq, however. It will look something like this:

Posted 03/20/2010 at 7:02 AM
Los Angeles SEO said:

the people.xml which is not created yet, you just need to create XDocument, store xml data in it, and save it calling xmlDoc.Save

Posted 03/24/2010 at 7:06 AM
Joe Byrnes said:

How can I find the equivilant in vb 2008?

Thanks

Posted 03/24/2010 at 10:37 PM
hehe said:

VB sucks X-)

Posted 03/29/2010 at 11:56 AM
chatroulette software said:

It’s very hard to find any useful and informative articles on this topic, but your blog helped me a lot! Thanks

Posted 04/14/2010 at 7:07 AM
Dora games said:

Than kyou for the tips.

I can really use those.

Posted 04/16/2010 at 2:48 PM
Car games said:

Thanks for your useful post, for some reason i had some big problems while implement it on my site but i hope it will be ok now

Posted 04/17/2010 at 1:44 PM
Islam Perth said:

I was looking for this information from long time and found your post. It will be very useful for me. Thanks

Posted 04/21/2010 at 10:26 PM
Wholesale Brand Name Clothing said:

the first time through. how would you create the xml file. i have done it before with xmldocument but not with tthe new linq stuff.

Posted 04/22/2010 at 2:53 PM
Carmax said:

I would like to thank you for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well.

Posted 04/27/2010 at 7:19 AM
Carmax said:

I would like to thank you for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well.

Posted 04/27/2010 at 7:19 AM
Medical Tour in India said:

a routine that accepts a starting url and then traverses the website and picks up the website hierarchy "dynamically" and construct the xml accordingly.

Posted 04/27/2010 at 7:50 AM
Easy Ways To Make Money said:

It’s very hard to find any useful and informative articles on this topic, but your blog helped me a lot! Thanks

Posted 04/28/2010 at 2:57 AM
cara menambah tinggi badan said:

LINQ has the amazing ability to communicate and interact with many various data sources - databases, XML and varying objects. In this tutorial, we will be using a Windows Form to look at how we can use LINQ to add data to an XML file for storage.

Posted 04/30/2010 at 2:00 AM
Whole Sale Brand Name Clothing said:

Its A Cool Post dear...

simply informative...

<a href="http://www.wholesaleclothingworld.com">Wholesale Brand Name Clothing</a>

Must Look..

Posted 04/30/2010 at 8:23 AM
Blog said:

Its an amazing post...

May b helpful 4 us too…

Hope u will provide us more info. On that ....

www.icater.ca

Toronto Catering

Must Look...

Posted 05/02/2010 at 5:55 AM
Cheap Flights said:

Convincing way of expression due to that reason ur post become so informative.

Thanx 4 that post and info.

Open it..

www.cheapflightsservice.com

Cheap Flights

Posted 05/02/2010 at 10:51 PM
Mathew Day said:

This post shows the information which is close to standard.

Hope next You will again post a nice Artical/Information.

Visit us:

Mathew Day:

<a href="www.mathewday.com">Mathew Day</a>

Posted 05/03/2010 at 10:34 AM
Mathew Day said:

This post shows the information which is close to standard.

Hope next You will again post a nice Artical/Information.

Visit us:

Mathew Day:

www.mathewday.com

Posted 05/03/2010 at 10:34 AM
cara meninggikan badan said:

LINQ has the amazing ability to communicate and interact with many various data sources - databases, XML and varying objects.

Posted 05/04/2010 at 12:29 AM
Internet Hosting said:

This post shows the information which is close to standard.

Hope next You will again post a nice Artical/Information.

Posted 05/04/2010 at 10:15 AM
Leadership Styles said:

accepts a starting url and then traverses the website and picks up the website hierarchy "dynamically" and construct the xml accordingly.

Posted 05/06/2010 at 12:32 PM
Cheap Flights said:

Convincing way of expression due to that reason ur post become so informative.

Thanx 4 that post and info.

Posted 05/09/2010 at 7:46 AM
Contract Hire said:

Nice Informative Blog having nice sharing

including reasonable comments here...

Posted 05/11/2010 at 10:00 AM
Contract Hire said:

Nice Informative Blog having nice sharing

including reasonable comments here...

Posted 05/11/2010 at 10:01 AM
Online Casino said:

Wonderful Article! I have bookmarked this page and I love to share this with my friends and circle of influence.

Posted 05/12/2010 at 1:28 AM
sonnerie portable gratuit said:

Why didn’t I find this post earlier? Keep up the good work!

Posted 05/13/2010 at 3:57 AM
Easy Ways To Make Money said:

we can move to the code-behind and add the namespaces we are going to use. The majority of which are added automatically. We may need to add System.Xml.Linq, however. It will look something like this:

<a href="http://www.wncafe.com/">Easy Ways To Make Money</a>

Posted 05/13/2010 at 10:01 AM
tinggi badan said:

LINQ has the amazing ability to communicate and interact with many various data sources - databases, XML and varying objects. In this tutorial, we will be using a Windows Form to look at how we can use LINQ to add data to an XML file for storage. This is a quick and easy alternative to using a database. An XML file would be good for storing less information, which is not sensitive.

Posted 05/14/2010 at 2:54 AM
Boutique Hotels Florence said:

wow, awesome post, I was wondering what are the best registry cleaner. and found your site by yahoo, many userful stuff here, now i have got some idea. I've bookmark your site and also add rss. keep us updated.

Posted 05/17/2010 at 4:04 AM
Steam Showers said:

Nice information, many thanks to the author. It is incomprehensible to me now, but in general, the usefulness and significance is overwhelming. Thanks again and good luck!

Posted 05/17/2010 at 6:33 AM
organic gardening said:

I completely agree with the above comment, the internet is with a doubt growing into the most important medium of communication across the globe and its due to sites like this that ideas are spreading so quickly.

Posted 05/17/2010 at 7:35 AM
Oklahoma City OK Computer Repair said:

Geeks Oklahoma City OK Computer Repair Services will fix your computer cheaper than the Geek Squad.

Posted 05/19/2010 at 5:21 AM
Nokia 5800 games said:

the best prize that life has to offer is the chance to work hard at work worth doing.

Posted 05/23/2010 at 2:39 AM
Nokia 5800 games said:

wow, awesome post, I was wondering what are the best registry cleaner. and found your site by yahoo, many userful stuff here, now i have got some idea. I've bookmark your site and also add rss. keep us updated.

Posted 05/23/2010 at 2:41 AM
best buy ipod said:

Nice information, many thanks to the author.

Posted 05/23/2010 at 3:07 AM
japanese fashion said:

would like to thank you for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well.

Posted 05/26/2010 at 3:51 AM
sports betting said:

It's a good post.

Posted 05/27/2010 at 1:44 AM
Online Casino said:

I love this post.

Posted 05/27/2010 at 1:46 AM
Web Hosting said:

I love this post. Expecting more like this.

Posted 05/27/2010 at 1:49 AM
credit card said:

Awesome.

Posted 05/27/2010 at 1:53 AM
Insurance said:

I read it. Its good.

Posted 05/27/2010 at 1:58 AM
biofuel said:

Good post.

Posted 05/27/2010 at 2:00 AM
Acai Berry Colon Cleanse said:

Thanks for the nice post. I am expecting some different idea from your side. You always represent some new thought in your post.

Posted 05/27/2010 at 9:03 AM
Auto spiele said:

accepts a starting url and then traverses the website and picks up the website hierarchy "dynamically" and construct the xml accordingly.

Posted 05/27/2010 at 3:46 PM
Sell Junk Car said:

I am bookmarking this post. Its Awesome.

Posted 05/28/2010 at 12:28 AM
Acai Berry Colon Cleanse said:

Hey this is really nice information. I was looking for something similar like this. Thanks for this useful information.

Posted 05/28/2010 at 6:50 AM
Florida Drug Rehab said:

Its a great pleasure reading your blog. The blog content is powerful.Very Good.

Posted 05/30/2010 at 10:28 PM
Drug Rehab Florida said:

Its a great pleasure reading your post.Its full of information I am looking for and I love to post a comment that "The content of your post is awesome" Great work.

Posted 05/30/2010 at 10:32 PM
Addiction Treatment said:

Its a nice comment.I love reading it in detail and bookmarked it.I found some real value in the content.Loved it.

Posted 05/30/2010 at 10:37 PM
La Zagaleta said:

Useful, although somewhat technical information on this blog.

Posted 05/31/2010 at 10:06 AM
damenarmbanduhren said:

great thx

Posted 05/31/2010 at 12:41 PM
The Employment Law Group said:

Good one.I love reading it every bit.

Posted 06/03/2010 at 9:14 AM
Las Vegas Tours said:

Its a great posting.I really like it.

Posted 06/04/2010 at 7:20 AM
Las Vegas Travel Guide said:

Wonderful posting. Very knowledgable.

Posted 06/04/2010 at 7:23 AM
osteoarthritis said:

The xml is populated using hardcoded urls. (Which would be totally fine for an example that wasn't titled "Creating an ASP.NET SiteMap dynamically..."

Posted 06/04/2010 at 8:00 AM
SEO UK said:

LINQ query looks similar to a SQL statement. We select all data from the XML file and then loop through this data, outputting all results into the text box.

Posted 06/07/2010 at 2:32 AM
Business Cards said:

Its my pleasure that I got an opportunity to comment on this post. Its a very nice post and I love it.

Posted 06/08/2010 at 9:36 AM
Handbags said:

Nice Post. Expecting many like this from you.

Posted 06/10/2010 at 12:17 AM
carfax or autocheck said:

What an amazing post that I have ever come through. It gives the information that I was really searching for the past week and I am really satisfied with this post. Need more like this. Thank you.

Posted 06/12/2010 at 1:30 AM
Online PhD in Musical Education said:

Its a very good post, i had subscribed your post.Please update the latest information.

Posted 06/12/2010 at 6:19 AM
Online PhD in Musical Education said:

Its a very good post, i had subscribed your post.Please update the latest information.

Posted 06/12/2010 at 6:19 AM
Online PhD in Workforce Development Education said:

Its a very good post, i had subscribed your post.Please update the latest information.

Posted 06/12/2010 at 8:01 AM
Physiotherapists said:

this is really nice information. I was looking for something similar like this. Thanks for this useful information.

Posted 06/14/2010 at 1:13 AM
smuckers natural peanut butter said:

I have never thought that surfing online can be so much beneficial and having found your blog, I feel really happy and grateful for providing me with such priceless information.

Posted 06/14/2010 at 9:35 PM
web design new york said:

web designs and prepare for the brave, new face of tomorrow. Although trends don’t start and stop

Posted 06/15/2010 at 3:19 AM
Puzzle Games said:

The xml is populated using hardcoded urls. (Which would be totally fine for an example that wasn't titled "Creating an ASP.NET SiteMap dynamically..."I would have expected that this should contain a routine that accepts a starting url

Posted 06/18/2010 at 6:46 AM
Amish Country Furniture PA said:

Thanks for heads up! I love getting good xml advice with screenshots.

Posted 06/18/2010 at 9:18 AM
penis enlarger said:

LINQ query looks similar to a SQL statement. We select all data from the XML file and then loop through this data, outputting all results into the text box.

Posted 06/19/2010 at 1:40 AM
wicked said:

Hello Your sample are very useful and easy to understand

However I have a problem on dealing 2 same elment with 2 diff attribute value.

Ex. <phone type:"home"> 123-456-7 </phone>

<phone type:"work">0934-4567-99 </phone>

How can I get the phone number for home using the Xelement.value ?

Thanks in advance

Posted 06/20/2010 at 1:02 AM
Ball Bearing said:

Thanks for your code, very useful

Posted 06/21/2010 at 8:56 PM
Used Auto Parts said:

amazing ability to communicate and interact with many various data sources - databases, XML and varying objects.

Posted 07/06/2010 at 6:33 PM
Dining Table said:

Thanks for post. It’s really informative stuff. I really like to read.Hope to learn a lot and have a nice experience here! my best regards guys!

<a href="http://www.diningtables.org.uk">dining table</a>

Posted 07/07/2010 at 2:38 AM
Luxury Villas said:

We select all data from the XML file and then loop through this data, outputting all results into the text box. Finally, we check to see if the XML file is empty.Thanks

Posted 07/07/2010 at 10:11 AM
California Loan Modification said:

it is useful post for me ,I love getting good xml advice with screenshots.Thanks for share it

Posted 07/09/2010 at 7:40 AM
Technology News Magazine said:

I love this blog and subcribed to rss feed. I love all the blogs of this site

Posted 07/09/2010 at 5:13 PM
web design services said:

I am pretty much happy to overcome all the difficulties and have some spare time to read and enjoy reading your blog. Your new post can just make me sit in front of the computers for hours.

Posted 07/12/2010 at 10:27 AM
office chairs said:

This ergonomic high back office chair extends the full length of the back,up to the shoulders and includes support for the head and neck. Our chairs are crafted to perfection and designed to the bodies natural shape, you will find complete comfort with its PU leather material and padded arm rests.

The chair is fitted with optimised functions which include gas height adjustment and tilt mechanism, to allow for greater comfort and allowing you to find your ideal position.

Our executive range of office chairs are built to be Safe, to last for years and cannot be beat in any head to head comparison in its class. Easy assemble, a strong nylon base and 360° swivel, top this PU leather, a fantastic executive look.

Posted 07/12/2010 at 11:20 AM
Search Engine Optimisation UK said:

how we can use LINQ to add data to an XML file for storage. This is a quick and easy alternative to using a database. An XML file would be good for storing less information, which is not sensitive.

Posted 07/17/2010 at 11:31 PM
Hosting Packages said:

The xml is populated using hardcoded urls. (Which would be totally fine for an example that wasn't titled "Creating an ASP.NET SiteMap dynamically...

Posted 07/18/2010 at 7:06 PM
Medyum said:

The xml is populated using hardcoded urls. (Which would be totally fine for an example that wasn't titled "Creating an ASP.NET SiteMap dynamically...

Posted 07/19/2010 at 7:32 AM
Medyum said:

The xml is populated using hardcoded urls. (Which would be totally fine for an example that wasn't titled "Creating an ASP.NET SiteMap dynamically...

Posted 07/19/2010 at 7:33 AM
flex chat said:

How long have you been in this field? Certainly, you know a lot more than I do, I would love to know your sources!

Posted 07/22/2010 at 6:50 AM
Link Building said:

the best article I've found on XML in C# after days of searching, period. Thanks for the clear example.

Posted 07/22/2010 at 3:14 PM
bridal design said:

Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely helpful for me.

<a href="http://www.thebridaldesign.com">bridal design</a>

<a href="http://www.thebridaldesign.com">bridal dresses</a>

<a href="http://www.thebridaldesign.com">bridal botique</a>

Posted 07/22/2010 at 4:11 PM
Best SEO India said:

hard to find any useful and informative articles on this topic, but your blog helped me a lot

Posted 07/23/2010 at 7:03 PM
Cialis said:

This is a quick and easy alternative to using a database. An XML file would be good for storing less information, which is not sensitive.

Posted 07/25/2010 at 7:16 AM
Budget Travel Blog said:

Once our form is ready, we can move to the code-behind and add the namespaces we are going to use.

Posted 07/26/2010 at 8:35 AM
cheap hosting said:

this article is so easy, I do understand that too :)

Posted 07/27/2010 at 1:52 AM
pmu said:

great post thanks

Posted 07/28/2010 at 12:24 PM
link building service said:

the namespaces we are going to use. The majority of which are added automatically. We may need to add System.Xml.Linq, however. It will look something like this:

Posted 07/29/2010 at 7:11 AM
hearing school said:

I really like to read.Hope to learn a lot and have a nice experience here! my best regards guys!

Posted 07/29/2010 at 7:11 AM
meilleurs casinos en ligne said:

great article.. i really like it !! but i'm noob with xml it's difficult for me

Posted 07/29/2010 at 10:27 AM
DJ Equipment said:

LINQ has the amazing ability to communicate and interact with many various data sources - databases, XML and varying objects. In this tutorial, we will be using a Windows Form to look at how we can use LINQ to add data to an XML file for storage.

Posted 07/31/2010 at 11:08 AM
mustang wheels said:

This is a quick and easy alternative to using a database. An XML file would be good for storing less information, which is not sensitive.

Posted 08/01/2010 at 2:59 PM
Superhero Costumes said:

Once we have added our references, we will create an on-click handler for the view button. We will add the following code-behind:!

Posted 08/02/2010 at 5:55 AM
winamax said:

thanks for the interesting information

Posted 08/02/2010 at 11:38 PM
Wedding Planner said:

SQL and LINQ to Objects. In this article, we will be looking at LINQ to XML in Visual Studio.NET 2008. If you do not have 2008, you can download the LINQ Preview for VS.NET 2005 direct from Microsoft.

Posted 08/03/2010 at 4:26 AM
search engine optimization and seo said:

The LINQ query looks similar to a SQL statement. We select all data from the XML file and then loop through this data

Posted 08/03/2010 at 11:59 PM
forex said:

thanks for sharing

Posted 08/04/2010 at 11:43 PM
joint pain treatment said:

the namespaces we are going to use. The majority of which are added automatically. We may need to add System.Xml.Linq, however. It will look something like this!

Posted 08/05/2010 at 3:59 AM
Miami Bankruptcy Attorneys said:

This is a good post. Thanks for sharing it.

Posted 08/05/2010 at 3:45 PM
acai max cleanse said:

Heya..thanks for the post and great tips..even I also think that hard work is the most important aspect of getting success.

Posted 08/07/2010 at 4:20 AM
acai berry weight loss said:

This is one of the best posts that I’ve ever seen; you may include some more ideas in the same theme. I’m still waiting for some interesting thoughts from your side in your next post.

Posted 08/07/2010 at 4:24 AM
Acai berry select said:

I have read a number of posts of yours, but this is the one that I like the most. So expecting some more ideas from your side. Thanks

Posted 08/07/2010 at 4:28 AM
acai berry said:

Thanks for giving me an amazing post, its great time to read your post. I’ve got some more interesting topic for discussion. So keep it up.

Posted 08/07/2010 at 4:32 AM
Diet solution program said:

Thanks for the nice post. I am expecting some different idea from your side. You always represent some new thought in your post.

Posted 08/07/2010 at 4:33 AM
how to get rid of stretch marks said:

I really liked the post and the stories are really thanks for sharing the informative post.

Posted 08/07/2010 at 4:36 AM
how to get pregnant said:

Heya..thanks for the post and great tips..even I also think that hard work is the most important aspect of getting success.

Posted 08/07/2010 at 4:37 AM
Domain name registration said:

This ergonomic high back office chair extends the full length of the back,up to the shoulders and includes support for the head and neck. Our chairs are crafted to perfection and designed to the bodies natural shape, you will find complete comfort with its PU leather material and padded arm rests.

Posted 08/07/2010 at 6:28 AM
http://los angeles seo company said:

This is a quick and easy alternative to using a database. An XML file would be good for storing less information, which is not sensitive.

Posted 08/07/2010 at 7:22 AM
iphone Library App said:

LINQ has the amazing ability to communicate and interact with many various data sources - databases, XML and varying objects. In this tutorial, we will be using a Windows Form to look at how we can use LINQ to add data to an XML file for storage.

Posted 08/08/2010 at 3:27 AM
LED Pods said:

that this should contain a routine that accepts a starting url and then traverses the website and picks up the website hierarchy "dynamically" and construct the xml accordingly.

Posted 08/08/2010 at 4:06 PM
Kaizen said:

Our chairs are crafted to perfection and designed to the bodies natural shape, you will find complete comfort with its PU leather material and padded arm rests...

Posted 08/09/2010 at 7:17 AM
bonus betclic said:

thanks for sharing

Posted 08/09/2010 at 12:57 PM
Free dating sites said:

Good post! I am also going to write a blog post about this... thanks

Posted 08/13/2010 at 12:03 PM
Security Essentials said:

This is a quick and easy alternative to using a database. An XML file would be good for storing less information, which is not sensitive.

Posted 08/15/2010 at 1:09 PM
flowers to kolkata said:

I suggest this site to my friends so it could be useful & informative for them also. Great effort.I love flowers...I am also interested to send flowers all over the world....

Posted 08/16/2010 at 12:01 AM
Yeast Infection said:

i am using VB and doing programming i found this site very helpfull or me. because it give very good explanation about all topics.

Posted 08/16/2010 at 12:14 AM
6S said:

An XML file would be good for storing less information, which is not sensitive...

Posted 08/16/2010 at 12:53 PM
web site development service said:

I hope you'll be much more happy to visite my blog and enjoy all the benefits of web design and web site development.

Posted 08/16/2010 at 3:55 PM
web site development service said:

I hope you'll be much more happy to visite my blog and enjoy all the benefits of web design and web site development.

Posted 08/16/2010 at 3:56 PM
Life Insurance said:

a routine that accepts a starting url and then traverses the website and picks up the website hierarchy "dynamically" and construct the xml accordingly.

Posted 08/16/2010 at 4:05 PM
Watch salt online said:

Your post is amazing. Your thought process is unique and impressive. I like to read more from you.

Posted 08/17/2010 at 1:20 AM
Accident Insurance said:

how would you create the xml file. i have done it before with xmldocument but not with tthe new linq stuff.

Posted 08/17/2010 at 11:40 AM
sole f80 said:

Our ideal is normally unquestionably that is going to be all of the perfect solution to be able to shop forward. My personal much-loved might be most definitely width is certainly your ideal solution to assist you to check out onward. Your much-loved might be most certainly the idea is usually the optimum procedure so that you move ahead. In cases where somebody can be searching for some sort of an individual will need to give some thought to obtaining any through a great marketing online retailer. Our perfect is normally without a doubt the application is without a doubt this most beneficial means to help you search front. That you could very well discover as one really are and so take pleasure in making time for the situation.

Posted 08/17/2010 at 12:29 PM
<a href="http://www.usinsuranceonline.com/">Auto insurance quotes</a> said:

Visual Studio 2008 is an excellent software that we can make use of. I will used it myself for a number of projects, and I must say it turned out quite successful.

Posted 08/18/2010 at 1:23 AM
baby trend diaper champ said:

I hope you'll be much more happy to visite my blog and enjoy all the benefits of web design and web site development.

Posted 08/18/2010 at 2:47 AM
Moroccan furniture said:

Excellent site, where did you come up with the knowledge

in this article? Im happy I found it though.Thank you very much for this sharing.

Posted 08/18/2010 at 3:14 AM
Helen said:

Clean the vents behind your dryer in the beginning of winter; you're drying heavier clothes now, and they generate more lint. Clean vents will help your machine dry clothes more quickly, last longer, and you'll lower the risk of fires. Hardware stores carry kits that can help.

<a href="http://www.itiljobs.org/">ITIL jobs </a>

<a href="http://www.atlantaplasticsurgeryoffice.com/">Atlanta Plastic Surgery </a>

<a href="http://www.abtexintl.net/">Cotton Yarn </a>

<a href="http://www.ladieslinentrousers.net/">Ladies Linen Trousers </a>

Posted 08/19/2010 at 4:36 AM
cheap rascal flatts tickets said:

Generally I do not post on blogs, but I would like to say that this post really forced me to do so! really nice post.

Posted 08/19/2010 at 6:39 AM
Pennystocks said:

It's very important what you write and you show some of the information relevant that i need. Thanx mate! This my web:

Posted 08/20/2010 at 5:26 AM
jouer au casino said:

thanks for the tuto it will be very helpfull !

Posted 08/20/2010 at 7:00 AM
Missing you messages said:

Its great resource. i was finding that type inf and now i get it.thanks for this...

Posted 08/23/2010 at 3:28 AM
phentermine without prescription said:

you'll be much more happy to visite my blog and enjoy all the benefits of web design and web site development.

Posted 08/23/2010 at 6:13 AM
Cialis said:

good post

Posted 08/24/2010 at 1:21 PM
medyum said:

Thanks for such a great post and the review, I am totally impressed! Keep stuff like this coming.

Posted 08/25/2010 at 4:09 PM
coach outlet said:

coach outlet

Posted 08/26/2010 at 1:58 PM
louis vuitton bags said:

louis vuitton bags

Posted 08/26/2010 at 1:59 PM
phentermine 37.5 said:

Adding to XML File using LINQ and C# is a really very good article it is informative and helpful for all.

good script code are given here.

Posted 08/27/2010 at 3:28 AM
Poker Training said:

You have really defined an easy method to add XML file to C# and LinQ. I successfully added XML file to C#.thanks

Posted 08/30/2010 at 8:10 AM
Dog Crates said:

In cases where somebody can be searching for some sort of an individual will need to give some thought to obtaining any through a great marketing online retailer. Our perfect is normally without a doubt the application is without a doubt this most beneficial means to help you search front.

Posted 08/30/2010 at 9:22 AM
medyum-sihir said:

CXML a nice way to add file thanks

Posted 08/30/2010 at 10:08 AM
Funeral Insurance said:

LINQ has the amazing ability to communicate and interact with many various data sources - databases, XML and varying objects.

Posted 08/30/2010 at 1:23 PM
carpet cleaning service said:

The code is quite helpful. Thank you for sharing.

Posted 09/01/2010 at 1:26 AM
los angeles web design said:

Nice coding.It will really help me.

Posted 09/02/2010 at 3:59 AM
los angeles web design said:

Awesome post.Nice coding.

Posted 09/02/2010 at 4:01 AM

Leave a Comment