-1
當我運行下面的代碼,它是示出了錯誤如何解決錯誤「異常已被拋出通過調用目標」
「異常已被拋出通過調用目標」
我能做些什麼來解決這個問題?
public LinqToXml()
{
XDocument document = XDocument.Load(@"D:\\Data.xml");
#region Fetch All the Books
var books = from r in document.Descendants("book")
select new
{
Author = r.Element("author").Value,
Title = r.Element("title").Value,
Genere = r.Element("genre").Value,
Price = r.Element("price").Value,
PublishDate = r.Element("publish_date").Value,
Description = r.Element("description").Value,
};
foreach (var r in books)
{
com_xdocuments.Items.Add(r.PublishDate + r.Title + r.Author);
}
#endregion
}
什麼是內部異常? – Zabavsky