I was wondering if someone could help. I'm trying to create an xml file. I've populated a data table mytable, in dataset mydataset. It has 3 columns a, b, and c.
An Example of this data would be...
A B C
1 James 10
1 Simon 8
1 Steve 9
2 James 12
2 Simon 3
3 James 6
3 Steve 18
I've made a function to create my xml, (see code below)
The output of this is fine for my first attempt at an XML file but how would I group column a "department"? I understand Linq is much like SQL and should be able to add a Group by statement but where/how.
From Items In myDataSet.myTable Group by items.a ?
This expects an into? Where? Can someone give me an example or point me in the right direction, I can't seem to find any on the web.
Public Function TextXml()
Dim doc = New XElement("myHeader", _
New XElement("mysubheader", _
New XElement("date", Textbox1.Text), _
From Items In myDataSet.myTable _
Select New XElement("mydetails", _
New XElement("Department", items.a), _
New XElement("Name", items.b), _
New XElement("Amount", items.c)))