string uriGroup = "http://localhost:8000/Service/Group"; //rest based http GET
private void button14_Click(object sender, EventArgs e)
{
XDocument xDoc = XDocument.Load(uriGroup); //Load the uri into the xdoc
var groups = xDoc.Descendants("Group") //descendants of xml query "Group"
.Select(n => new
{
GroupID = n.Element("GroudID").Value,
Group = n.Element("GroupName").Value, //first "Group" Sets the column title, second sets the Element to be listed in this case "GroupName" from my service.
})
.ToList();
dataGridView2.DataSource = groups;
もちろん、私はdataGridを使用していますが、リストボックスでも同じことができると確信していますか? これがダビデに役立つことを願っています。