62,046
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
public partial class Table_1
{
public System.Guid ID { get; set; }
public Nullable<System.DateTime> AduitDate { get; set; }
public string Value { get; set; }
}
using (TestEntities te = new TestEntities())
{
Table_1 ddd = te.Table_1.First(x => x.ID == id);
ddd.Value = "4444";
ddd.AduitDate = null;
te.SaveChanges();
/*
* exec sp_executesql N'UPDATE [dbo].[Table_1]
* SET [AduitDate] = NULL, [Value] = @0
* WHERE ([ID] = @1)
* ',N'@0 varchar(50),@1 uniqueidentifier',@0='4444',@1='4D48ADF2-CAD8-43CD-BAA8-C3C46FD7AAC3'
*/
}
using (TestEntities te = new TestEntities())
{
Table_1 ddd = te.Table_1.First(x => x.ID == id);
ddd.Value = "5555";
te.SaveChanges();
/*
* exec sp_executesql N'UPDATE [dbo].[Table_1]
* SET [Value] = @0
* WHERE ([ID] = @1)
* ',N'@0 varchar(50),@1 uniqueidentifier',@0='5555',@1='4D48ADF2-CAD8-43CD-BAA8-C3C46FD7AAC3'
*/
}