Linq to Xml to Datagridview

Posted by David Archer on Stack Overflow See other posts from Stack Overflow or by David Archer
Published on 2010-04-13T22:53:07Z Indexed on 2010/04/13 23:03 UTC
Read the original article Hit count: 667

Filed under:
|
|
|

Right, starting to go crazy here. I have the following code:

var query = (from c in db.Descendants("Customer")
                             select c.Elements());
                dgvEditCusts.DataSource = query.ToList();

In this, db relates to an XDocument.Load call. How can I get the data into the DataGridView?

Just thought I should mention: it returns a completely blank dgv

© Stack Overflow or respective owner

Related posts about c#

Related posts about datagridview