Exemple #1
0
        protected void UpdateCommand(DatabaseParameters keys, DatabaseParameters values, string table)
        {
            int           num;
            StringBuilder builder = new StringBuilder("UPDATE " + table + " SET ");

            if (values != null)
            {
                for (num = 0; num < values.Count; num++)
                {
                    builder.Append(values[num].FieldName + " = " + (((values[num].ParamType == DBDataType.Formula) || (values[num].ParamType == DBDataType.SQLFormula)) ? values[num].FieldValue : ((values[num].FieldValue.Length > 0) ? ((values[num].IsUnicode ? "N" : "") + "'" + values[num].FieldValue + "'") : (values[num].IsNullable ? "NULL" : "''"))) + ",");
                }
            }
            builder.Remove(builder.Length - 1, 1);
            if (keys != null)
            {
                for (num = 0; num < keys.Count; num++)
                {
                    builder.Append((num == 0) ? " WHERE " : (" " + keys[num].ParamLinkage.ToString() + " "));
                    builder.Append(((keys[num].ParamType == DBDataType.Formula) || (keys[num].ParamType == DBDataType.SQLFormula)) ? (keys[num].FieldName + " = " + keys[num].FieldValue) : (keys[num].FieldName + " = '" + keys[num].FieldValue + "'"));
                }
            }
            sql = builder.ToString();
        }
Exemple #2
0
 public void Remove(DatabaseParameters value)
 {
     base.List.Remove(value);
 }
Exemple #3
0
 public int IndexOf(DatabaseParameters value)
 {
     return(base.List.IndexOf(value));
 }
Exemple #4
0
 public void Insert(int index, DatabaseParameters value)
 {
     base.List.Insert(index, value);
 }
Exemple #5
0
 public int Add(DatabaseParameters value)
 {
     return(base.List.Add(value));
 }