gpt4 book ai didi

c# - Linq 从 View 中选择行?

转载 作者:太空宇宙 更新时间:2023-11-03 11:22:46 24 4
gpt4 key购买 nike

我的 sql 数据库中有一个 View ,它映射到我的 dbml 文件中。让我们称之为userview

using(FooDataContext db = new FooDataContext()){
var users = from ur in db.userview
where ur.username == "james" //username is a colomn of userview
select ur;
}

出现以下错误

Could not find an implementation of the query pattern for source type 'TestProject.Models.userview'. 'Select' not found.

最佳答案

您是否已将 System.Linq 添加到您的代码文件中?

关于c# - Linq 从 View 中选择行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10390337/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com