Example #1
0
        public string get()
        {
            string query = "UPDATE " + this.table;

            if (record.Count == 0)
            {
                throw new Exception("Update : No any item is added in record");
            }

            if (wh == null)
            {
                throw new Exception("Update : where is not set");
            }

            var v_list = new List <string>();

            foreach (var d in record)
            {
                v_list.Add(d.Key + "='" + d.Value + "'");
            }

            query += " SET " + String.Join(", ", v_list);


            query += " WHERE " + wh.get();

            return(query);
        }
Example #2
0
        public string get()
        {
            string query = "DELTE FROM " + this.table;

            if (wh == null)
            {
                throw new Exception("Update : where is not set");
            }

            query += " WHERE " + wh.get();

            return(query);
        }