Example #1
0
        public static bool Delete(string table_name, string PK_name, string PK_value)
        {
            string sql = "DELETE FROM " + table_name + " WHERE " + PK_name + " = " + PK_value;

            if (AccessHelper.ExecuteSql(sql) > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #2
0
        public static bool Update(string table_name, string PK_name, string PK_value, string field_name, string field_value)
        {
            string sql = "UPDATE " + table_name + " SET " + field_name + " = " + field_value + " WHERE " + PK_name + " = " + PK_value;

            if (AccessHelper.ExecuteSql(sql) > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #3
0
        public static bool Add(string table_name, List <string> field_values)
        {
            string sql       = "INSERT INTO " + table_name + ValuesListToString(field_values);
            int    isChanged = AccessHelper.ExecuteSql(sql);

            if (isChanged > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }