Updating data with linq
LINQ to XML was developed with Language-Integrated Query over XML in mind from the beginning.
It takes advantage of standard query operators and adds query extensions specific to XML.
If the type of the indexed-property uses a type-converter that supports conversion from a string, the type will automatically convert to its appropriate type. Please Note, If wish to ADD new rows to the Database, you will require am INSERT Command for the Data Adapter. Original; What happens here, is the Data Adapter calls the Update command and saves the changes back to the database. Even without Language-Integrated Query capabilities LINQ to XML represents a significant stride forward for XML programming. Here is how you would construct the same XML tree by using LINQ to XML functional construction.The next section of this document, "Programming XML", provides more detail on the in-memory XML Programming API aspect of LINQ to XML. XElement contacts = new XElement("contacts", new XElement("contact", new XElement("name", "Patrick Hines"), new XElement("phone", "206-555-0144", new XAttribute("type", "home")), new XElement("phone", "425-555-0145", new XAttribute("type", "work")), new XElement("address", new XElement("street1", "123 Main St"), new XElement("city", "Mercer Island"), new XElement("state", "WA"), new XElement("postal", "68042") ) ) ); Notice that by indenting (and squinting a bit) the code to construct the XML tree shows the structure of the underlying XML.