Linq

Exploring linq and insights from my journey

Microsoft C#, LINQ, XML, WPF and the Lack of Good Examples

Linq

Ok, My rant for the day is about trying to use Microsoft C# and LINQ and XML and WPF. I spend more time trying to figure out simple stuff, because nothing exists as solid examples of how to do what I need to do.I spend so much of my time trying to find decent examples […]

Read More

Writing Out LINQ to XML Documents to CSV Text Files

Linq

This may sound stupid, but I wanted to store some text parsing I was doing for some VDP projects in LINQ to XML XDocuments. So, I created the following:XDocument recs = new XDocument();XElement records1 = new XElement(“Records”);XElement record1 = new XElement(“Record”);record1.Add(new XElement(“id”, “1”),new XElement(“Name”,”Test”),new XElement(“Address”,”123 Anywhere”));records1.Add(record1);recs.Add(records1);which should create an xml document looking like this:<Records><Record><id>1</id><Name>Test</Name><Address>123 Anywhere</Address></Record></Records> […]

Read More