linq语言查询数据库的单个字段。

linq语言查询数据库的单个字段。,第1张

public List<string> GetCompany()      //table_Company :建立的表名

        {

            var depts = from dept in Dc.table_Company 

                        select dept.公司名称                 //公司名称为主键

            return depts.ToList()        //出错!!!   

                                                     出错提示:不能将类型List<string>隐式转化为table_company 

        }

select top 10 * from TableA A where A.id not in (select top 10 id from TableA order by id ) order by id

TableA.OrderBy(item =>item.id).Skip(10).Take(10)

这是因为 dr["TeaAge"] 的类型是 object,而 result.TeaAge 的类型是 int 。 写: C# code TextBox1.Text = result.TeaAge==null "null":result.TeaAge.ToString ()


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/6791286.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-28
下一篇 2023-03-28

发表评论

登录后才能评论

评论列表(0条)

保存