XML reader, export data into a file C# Visual Studio 2012



I have this Windows form, that inside a button I call a API and I get the information requested. This works very well but I am looking for its when I request the data, I would like to be able to export it into a xml file or to a CSV file. There's a way to achieve this?, here yo have my code.


Thanks



proxy.Dashboard pr = new proxy.Dashboard();
pr.APIKeyValue = new proxy.APIKeyHeader();
pr.APIKeyValue.Value = "25478-69874-fde44-ertyy";
proxy.ProjectData[] nc = pr.GetAllProjectData();

StringBuilder sb = new StringBuilder();
foreach (proxy.ProjectData som in nc)
{
sb.AppendLine("\r\n");
sb.AppendLine("\r\n" + som.ProjectTitle + " " + som.ProjectID + " " + som.PublishStatus);
}

label1.Text = sb.ToString();

No comments:

Post a Comment