I get error illegal characters in path with this line of code
var doc = XDocument.Load(openBatch.GetOpenBatchSummary("xxxx", "xxxx", "xxxx", "", "", ""));
var summary = from r in doc.Descendants("OpenBatchSummary")
select new
{
PaymentTypeID = r.Element("Payment_Type_ID"),
Return = r.Element("Return"),
Sale = r.Element("Sale"),
};
foreach (var i in summary)
{
ListViewItem it = new ListViewItem(i.PaymentTypeID.ToString());
it.SubItems.Add(i.Sale.ToString());
it.SubItems.Add(i.Return.ToString());
listView1.Items.Add(it);
}
But when I test the through this line of code there is the xml data's
var test = openBatch.GetOpenBatchSummary("xxx", "xxxx", "xxx", "", "", "");
MessageBox.Show(test);
And here is the output:
Use XDocument.Parse
, not XDocument.Load
. You are trying to load the content from a file that way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With