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.
Not that the XML should matter too much, but here's an example:
<Root>
<Customer>
<CustomerNumber>1</CustomerNumber>
<EntryDate>2010-04-13T21:59:46.4642+01:00</EntryDate>
<Name>Customer Name</Name>
<Address>Address</Address>
<PostCode1>AB1</PostCode1>
<PostCode2>2XY</PostCode2>
<TelephoneNumber>0123456789</TelephoneNumber>
<MobileNumber>0123456789</MobileNumber>
<AlternativeNumber></AlternativeNumber>
<EmailAddress>email@address.com</EmailAddress>
</Customer>
</Root>