이 코드를 출력 할 때 중괄호없이 번호 만 원하면 {가격 : 1446}이됩니다. 이것을 할 수있는 방법이 있습니까? 또한 가격 가치를 얻은 후에 십진수으로 변환하고 싶습니다. 이것을 할 수있는 방법이 있습니까?LINQ 중괄호 제거, 캐스트 값
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();
는 당신이 우리에게 당신이 분석하고있는 XML 파일을 보여줄 수의
select (Int32)f.Element("price")
을 넣어? –