SQL Query to Lambda C#
本文关键字:Lambda to Query SQL | 更新日期: 2023-09-27 17:49:15
这个SQL查询的Lambda语句是什么?
update Table_Name
set Column_Name = REPLACE(REPLACE(Column_Name, CHAR(13), ' '), CHAR(10), ' ')
我已经试过了:
ExporttoExcel ete = new ExporttoExcel();
if (ete.BillingNotes != null)
{
ete.BillingNotes = ete.BillingNotes.Replace("'r", " ");
ete.BillingNotes = ete.BillingNotes.Replace("'n", " ");
}
a.SubmitChanges();
谢谢!
还是没有运气。有人知道吗?
以下是示例:
var tb = db.Table_Name.SingleOrDefault(x=>x.Id == 1);
if(tb != null)
tb.Column_Name = tb.Column_Name.Replace("''r","").Replace("''n","");
db.SaveChanges();
修改:
。ExecuteCommand("update ExporttoExcel set CardNotes = REPLACE(REPLACE(CardNotes, CHAR(13), ' '), CHAR(10), ' ')");
变量"a"代表DataContext。
希望别人能帮忙!谢谢!:)