【问题标题】:how to store value of queries in string如何将查询的值存储在字符串中
【发布时间】:2011-09-03 08:51:54
【问题描述】:

我必须在以下查询中将 CityName 和 StateAbbr 列的值存储在两个字符串中,如何仅使用一个查询来做到这一点

var GetLocation= (
      from results in db1.ZipCodes1 
      where results.ZIPCode==zipcode 
      select new { results.CityName, results.StateAbbr }
).First();

【问题讨论】:

  • 请参阅this 问题以获得答案。

标签: asp.net asp.net-mvc


【解决方案1】:

听起来像你想要的

 string CityName = GetLocation.CityName;
 string  StateAbbr = GetLocation.StateAbbr;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-08-06
    • 1970-01-01
    • 1970-01-01
    • 2013-03-01
    • 2018-04-08
    • 1970-01-01
    • 2018-12-21
    • 2017-12-25
    相关资源
    最近更新 更多