如何将数据库中某个字段的值更新为空值?

SqlParameter[] parameters = new SqlParameter[0];

SqlParameter para_cs_key = new SqlParameter("@sort", SqlDbType.Int, 4);
            para_cs_key.Value = DBNull.Value;
            parameters[0] = para_cs_key;

string sql = "UPDATE TABLENAME SET sort=@sort WHERE where......";

转载于:https://www.cnblogs.com/itecho/archive/2008/10/08/1306032.html

你可能感兴趣的:(如何将数据库中某个字段的值更新为空值?)