我必须在以下查询中将CityName和StateAbbr列的值存储在两个字符串中,如何只使用一个查询来执行此操作
var GetLocation= (
from results in db1.ZipCodes1
where results.ZIPCode==zipcode
select new { results.CityName, results.StateAbbr }
).First();
答案 0 :(得分:0)
听起来像你想要的
string CityName = GetLocation.CityName;
string StateAbbr = GetLocation.StateAbbr;