/// <summary> /// Adds a parameter to the collection /// </summary> /// <param name="Name">The name of the parameter</param> /// <param name="Val">The value of the parameter</param> /// <param name="Type">The type of paramter you are adding</param> /// <param name="Output">Determines whether the parameter is of type output</param> public void Add(string Name, object Val, FieldType Type, bool Output) { Parameter p = new Parameter(Name, Val, Type, Output); Add(p); }
/// <summary> /// Replaces a parameter from a command /// </summary> /// <param name="cmd">The command you want to replace the parameter from</param> /// <param name="param">The parameter you want to peform the replace on</param> private void ReplaceParameter(MySqlCommand cmd, Parameter param) { string paramValue = string.Empty; if (param.Value.GetType() == typeof(string)) { string Value = Tools.ConvertToUFT8(param.Value.ToString()); cmd.Parameters.Add(new MySqlParameter(param.Name, Value)); } else { cmd.Parameters.Add(new MySqlParameter(param.Name, param.Value)); } }
/// <summary> /// Adds a parameter to the collection /// </summary> /// <param name="p">The parameter you wish to add</param> public void Add(Parameter p) { //for (int i = 0; i < items.Count; i++) //{ // if (this[i].Name == p.Name) // { // throw new Exceptions.DuplicateParameterException("Parementer already exists in collection\r\n\r\n" + p.Name); // } //} items.Add(p); }