//字典 var dt = new Dictionary<string, object>(); dt.Add("id", 1); dt.Add("name", "jack"); dt.Add("createTime", DateTime.Now); var t66 = db.Updateable(dt).AS("student").WhereColumns("id").ExecuteCommand(); //字典集合 var dtList = new List<Dictionary<string, object>>(); dtList.Add(dt); dtList.Add(dt2); var t666 = db.Updateable(dtList).AS("student").WhereColumns("id").ExecuteCommand();
db.InsertableByDynamic (new { id = 1, name = "a" }) .AS("order") .WhereColumns("id").ExecuteCommand(); //sql UPDATE [order] SET [name]=@name WHERE [id]=@id @id:1,@name:a
where条件太灵活可能会有不同数据库不兼容情况
db.Updateable<object>() .AS("Order") .SetColumns("name", 1) .Where("id=1").ExecuteCommand();
根据ID为条件更新
db.Fastest<DataTable>().AS("Order").BulkUpdate(datatable, new string[] { "id" });
2016 © donet5.comApache Licence 2.0