Linq toEntity 从表中删除特定列
Linq to 实体查询通过匹配条件从表中删除特定列
`
public ActionResult deleteChecks(string checkValue)
{
check_master checks = (from table in db.check_master
where table.check_code == checkValue
select table).First();
//now how to delete/remove checks.mcheck
return View("Edit");
}`
只想更新表 check_master 中具有空值(所选行)的单个列元素
Linq to entity query to delete a specific column from a table by matching a condition
`
public ActionResult deleteChecks(string checkValue)
{
check_master checks = (from table in db.check_master
where table.check_code == checkValue
select table).First();
//now how to delete/remove checks.mcheck
return View("Edit");
}`
Only want to update a single column element with null value(of selected row) from the table check_master
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以将单个属性(映射到列)设置为 null 并将其保存到数据库
You can set a single property (which maps to a column) to null and save it to the database
{
}
{
}
实体框架仅适用于常量表方案。
请告诉您,您的全球目标是什么,也许有一些更合适的方法来实现它。
更新:
Entity framework works with constant table scheme only.
Tell please, what your global aim is, may be there's some more suitable way to do it.
Updated:
我认为Linq to Entities只支持DML,不支持DDL操作。
因此,您必须使用存储过程或 ADO.NET 原始查询。
编辑
您可以像这样进行简单的更新:
I believe that Linq to Entities only support DML, it does not support DDL operations.
So you would have to use stored procedure or ADO.NET raw query.
EDIT
you can do simple update like this :