sql语句:UPDATE `vol`.`test_number` SET `ProductCode` = '33', `ProductName` = '1', `NumberQty` = 0 WHERE `id` = 3; 用SqlSugar写这个SQL语句
时间: 2023-04-10 15:01:16 浏览: 171
SQL UPDATE 语句
5星 · 资源好评率100%
可以使用以下代码:
var db = new SqlSugarClient(new ConnectionConfig()
{
ConnectionString = "your connection string",
DbType = DbType.MySql,
IsAutoCloseConnection = true
});
db.Updateable<TestNumber>()
.SetColumns(t => new TestNumber()
{
ProductCode = "33",
ProductName = "1",
NumberQty = 0
})
.Where(t => t.Id == 3)
.ExecuteCommand();
阅读全文