/// <summary> /// Adds the specified <see cref="AceQLParameter"/>. object to the <see cref="AceQLParameterCollection"/>. /// </summary> /// <param name="value">The <see cref="AceQLParameter"/> to add to the collection.</param> /// <exception cref="System.ArgumentNullException">If value is null.</exception> public void Add(AceQLParameter value) { if (value == null) { throw new ArgumentNullException("value is null!"); } aceqlParameters.Add(value); }
/// <summary> /// Adds a value to the end of the <see cref="AceQLParameterCollection"/>. /// </summary> /// <param name="parameterName">The name of the parameter.</param> /// <param name="value">The value to be added. Cannot ne bull.</param> /// <exception cref="System.ArgumentNullException">If parameterName or value is null.</exception> public void AddWithValue(string parameterName, object value) { if (parameterName == null) { throw new ArgumentNullException("parameterName is null!"); } AceQLParameter aceQLParameter = new AceQLParameter(parameterName, value); aceqlParameters.Add(aceQLParameter); }
/// <summary> /// Removes the <see cref="AceQLParameter"/> from the <see cref="AceQLParameterCollection"/> /// at the specified parameter name. /// </summary> /// <param name="parameterName">The name of the <see cref="AceQLParameter"/> to Remove.</param> public void RemoveAt(string parameterName) { for (int i = 0; i < aceqlParameters.Count; i++) { AceQLParameter aceQLParameter = aceqlParameters[i]; if (aceQLParameter.ParameterName.Equals(parameterName)) { aceqlParameters.RemoveAt(i); return; } } }
/// <summary> /// Removes the specified <see cref="AceQLParameter"/> from the collection. /// </summary> /// <param name="value">The object to Remove from the collection.</param> public void Remove(object value) { for (int i = 0; i < aceqlParameters.Count; i++) { AceQLParameter aceQLParameter = aceqlParameters[i]; if (aceQLParameter.Value.Equals(value)) { aceqlParameters.RemoveAt(i); return; } } }
/// <summary> /// Gets the location of the specified <see cref="Object"/> within the collection. /// </summary> /// <param name="value">The <see cref="Object"/> to find.</param> /// <returns> The zero-based location of the specified <see cref="Object"/> that is a <see cref="AceQLParameter"/> within the collection. Returns -1 when the object does not exist in the <see cref="AceQLParameterCollection"/>.</returns> /// <exception cref="System.ArgumentNullException">If parameterName is null.</exception> public int IndexOf(object value) { for (int i = 0; i < aceqlParameters.Count; i++) { AceQLParameter aceQLParameter = aceqlParameters[i]; if (aceQLParameter.Value.Equals(value)) { return(i); } } return(-1); }
/// <summary> /// Gets the <see cref="AceQLParameter"/> for it's name. /// </summary> /// <param name="parameterName">Name of the <see cref="AceQLParameter"/>.</param> /// <returns>The <see cref="AceQLParameter"/> for the parameter name.</returns> public AceQLParameter GetAceQLParameter(string parameterName) { for (int i = 0; i < aceqlParameters.Count; i++) { AceQLParameter aceQLParameter = aceqlParameters[i]; if (aceQLParameter.ParameterName.Equals(parameterName)) { return(aceQLParameter); } } return(null); }
/// <summary> /// Adds a value to the end of the <see cref="AceQLParameterCollection"/>. /// To be used for Blobs insert or update. /// </summary> /// <param name="parameterName">Name of the parameter.</param> /// <param name="stream">The Blob stream to read. Cannot be null.</param> /// <param name="length">The Blob stream length.</param> /// <exception cref="System.ArgumentNullException">If parameterName or stream is null.</exception> public void AddWithValue(string parameterName, Stream stream, long length) { if (parameterName == null) { throw new ArgumentNullException("parameterName is null!"); } if (stream == null) { throw new ArgumentNullException("stream is null!"); } AceQLParameter aceQLParameter = new AceQLParameter(parameterName, stream, length); aceqlParameters.Add(aceQLParameter); }
/// <summary> /// Gets the location of the specified <see cref="AceQLParameter"/> with the specified name. /// </summary> /// <param name="parameterName">Name of the parameter.</param> /// <returns> The case-sensitive name of the <see cref="AceQLParameter"/> to find.</returns> /// <exception cref="System.ArgumentNullException">If parameterName is null.</exception> public int IndexOf(string parameterName) { if (parameterName == null) { throw new ArgumentNullException("parameterName is null!"); } for (int i = 0; i < aceqlParameters.Count; i++) { AceQLParameter aceQLParameter = aceqlParameters[i]; if (aceQLParameter.ParameterName.Equals(parameterName)) { return(i); } } return(-1); }