Converting list of strings to xml

dcboy

New Member
One of my database tables has a lot of records with a column containing xml data stored as a string. What is the best way of retrieve this data and parse the string to get specific information which i wish to bind to my UI. Currently I am doing this - The data column of my Customer table has the xml data stored as a string\[code\]List<string> myData = http://stackoverflow.com/questions/10724127/new List<string>();//populate the list with the data from the customer tableList<XElement> myXmlData = new List<XElement>();foreach (var item in myData) { XElement xmlItem = XElement.Parse(item); myXmlData.Add(xmlItem); }this.DataContext = myXmlData;\[/code\]I am then using a data template to bind to the xml data that i require using the following\[code\]<TextBlock Text="{Binding Path=Element[Name].Value}"/>\[/code\]This works corrcctly but I am not sure if it's the right way of doing things. Performance is a concern so would doing this in any other way improve performance ?
 
Back
Top