如何在c#(多行)中使用linq更新Sql表行? [英] How do Update Sql table rows using linq in c# (multiple rows) ?

查看:84
本文介绍了如何在c#(多行)中使用linq更新Sql表行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用DataContext但是GetTable方法给出的错误就像t4p_cl_mgr(它是DataName中存在的TableName)一样。

I'm using DataContext but GetTable method gives error like t4p_cl_mgr ( it is TableName which exist in DataBase ) could not be found.

DataContext dc = new DataContext(ConnectionString);
                    var q = from a in dc.GetTable<t4p_cl_mgr>()
                            where a.ID == this.ID
                            select a;

推荐答案

使用Linq到Sql类文件(dbml)使用linq从表中获取数据并在编写上面编写的代码之前构建解决方案并使用VS intellisense编写相同的代码
Use Linq to Sql Class file(dbml) to fetch data from table using linq and build your solution before writing the code you have written above and write the same code using VS intellisense


这篇关于如何在c#(多行)中使用linq更新Sql表行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆