var query = (from o in context.Customers
select new{
o.uid,
o.Phone }
).Concat(
from n in context.Employees
select new {
n.uid,
n.Phone
}
);
报错:
错误 14 “System.Linq.IQueryable<AnonymousType#1>”不包含“Concat”的定义,并且最佳扩展方法重载“System.Linq.ParallelEnumerable.Concat<TSource>(System.Linq.ParallelQuery<TSource>, System.Collections.Generic.IEnumerable<TSource>)”的某些参数无效
select new{
o.uid,
o.Phone }
).Concat(
from n in context.Employees
select new {
n.uid,
n.Phone
}
);
报错:
错误 14 “System.Linq.IQueryable<AnonymousType#1>”不包含“Concat”的定义,并且最佳扩展方法重载“System.Linq.ParallelEnumerable.Concat<TSource>(System.Linq.ParallelQuery<TSource>, System.Collections.Generic.IEnumerable<TSource>)”的某些参数无效
解决方案 »
- 有什么简便方法把yyyyMMddhhmmssZ这样的时间格式字符串转成DateTime
- 菜鸟提问!button控件的click事件可不可以在特定情况下(禁用)或者(无反应)
- help!help!response出错了!远程服务器返回错误: (403) 已禁止。
- 用C#进行C/S网络编程,不同系统之间如何通信
- 用c#发送email附件 为什么报错 Invalid mail attachment
- 本人又做了个创建数据库的程序,当执行到创建视图的时候程序一直报错,一个视图都创建不成,很是郁闷??望高人看到,回复
- 高手过来:用vs2003制作的安装包,安装后,点击桌面快捷方式后会重新安装的问题
- 异步调用webservice,然后abort,但回调函数还是会被执行,咋搞的蔫?
- 请教关于窗口自动关闭?
- 这道题怎么编写啊?
- 请问button呈按下状态,是哪个属性
- C# 有免费的FTP客户端组件吗?
select new temp{
id=o.uid,
phone=o.Phone }
).Concat(
from n in context.Employees
selectnew temp{
id=o.uid,
phone=o.Phone }
);
class temp
{
public int id{get;set;}
public string phone {get;set;}
}
select new temp{
id=o.uid,
regionId = o.regionId; //??无法int?转换为int
phone=o.Phone }
).Concat(
from n in context.Employees
selectnew temp{
id=n.uid,
regionId= n.regionId///??
phone=n.Phone }
);
class temp
{
public int id{get;set;}
//---------------
public int regionId{get;set;} //
//-------------------
public string phone {get;set;}
}
///=========
regionId在数据库是定义是int的。
无论我将temp的regionId 定义为int 还是Int32都报 无法int?转换为int
多看看MSDN再玩这种语法糖。