LINQ 查询 ado.data 实体模型在 C# 中选择多个列
ECommerceAdoEntities oContext = new ECommerceAdoEntities();
var lstnames = from c in oContext.tbl_ShippingProfile select c.Name;
当我尝试对 ADO.net 实体数据模型数据源运行 linq 查询并返回多个列(c.Name、c.ID)时,它在 C# 中给出错误,
但在 VB 中我能够做到这一点。
Dim adoDataEntity As New ECommerceAdoEntities()
Dim lstAdoSource = From c In adoDataEntity.tbl_ShippingProfile Select c.Name, c.ID
知道为什么吗?
ECommerceAdoEntities oContext = new ECommerceAdoEntities();
var lstnames = from c in oContext.tbl_ShippingProfile select c.Name;
When I try to run a linq query against a ADO.net entity data model data source and return more than one column (c.Name,c.ID) it gives me error in C#
But in VB I am able to do it.
Dim adoDataEntity As New ECommerceAdoEntities()
Dim lstAdoSource = From c In adoDataEntity.tbl_ShippingProfile Select c.Name, c.ID
Any idea why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)