When I output this code, I get { Price: 1446 } when I only want the number without the braces. Is there a way to do this? Also, once I get the price value, I want to convert it to a decimal. Is there a way to do this?
var flightPrice = (from f in XElement.Load(MapPath("flightdata.xml")).Elements("flight")
where (string)f.Element("flightnumber") == FlightNumber
&& (string)f.Element("destinationairportsymbol") == Destination
select new { Price = (Int32)f.Element("price") }
).SingleOrDefault();
lblPrice.Text = flightPrice.ToString();