Hardly.SqlController.Update C# (CSharp) Method

Update() static private method

static private Update ( SqlTable table, string join, string set, string where, object vars ) : bool
table SqlTable
join string
set string
where string
vars object
return bool
        internal static bool Update(SqlTable table, string join, string set, string where, object[] vars)
        {
            if(table != null && set != null && where != null && vars != null) {
                try {
                    Debug.Assert(set.Trim().Length > 0);
                    Debug.Assert(where.Trim().Length > 0);
                    Debug.Assert(vars.Length > 0);

                    string sql = "update " + table.tableName;
                    if(join != null) {
                        sql += " " + join;
                    }
                    sql += " set " + set + " where " + where;

                    return ExecuteNonQuery(sql, vars) > 0;
                } catch(Exception e) {
                    Log.exception(e);
                }
            }

            Debug.Fail();
            return false;
        }

Usage Example

コード例 #1
0
 public bool Update(string join, string set, string where, object[] vars)
 {
     return(SqlController.Update(this, join, set, where, vars));
 }