我需要在“select new”部分的LINQ查询中添加换行符。我试过<br />
和"\n"
,但那些似乎没有工作。任何线索哪个命令用于获取换行符?LINQ换行符
我想使用linq在航空公司符号下显示航空公司图像。我应该将图像路径存储在xml文件中,然后使用linq进行查询?下面是到目前为止,我已经得到了代码:
var query = from f in XElement.Load(MapPath("flightdata2.xml")).Elements("flight") select new {
Airline = (string)f.Element("airline"), DepartureAirportSymbol = (string)f.Element("departureAirportSymbol"), DepartTime = (string)f.Element("departureTime"), DestinationAirportSymbol = (string)f.Element("destinationAirportSymbol"), ArrivalTime = (string)f.Element("arrivalTime"), Stops = (int)f.Element("numberOfStops"), Duration = (string)f.Element("duration"), Cabin = (string)f.Element("class"), Price = "$" + (Int32)f.Element("price") };
我们展示的代码和错误:) – 2011-04-20 15:16:54
出于好奇,你为什么需要这样做? – 2011-04-20 15:27:27