using System.Data;
using System.Collections;
using System.ComponentModel;
+using NpgsqlTypes;
+
+#if WITHDESIGN
using Npgsql.Design;
+#endif
namespace Npgsql
{
/// as well as their respective mappings to columns in a <see cref="System.Data.DataSet">DataSet</see>.
/// This class cannot be inherited.
/// </summary>
+
+ #if WITHDESIGN
[ListBindable(false)]
- // [Editor(typeof(NpgsqlParametersEditor), typeof(System.ComponentModel.Design.CollectionEditor))]
[Editor(typeof(NpgsqlParametersEditor), typeof(System.Drawing.Design.UITypeEditor))]
+ #endif
+
public sealed class NpgsqlParameterCollection : MarshalByRefObject, IDataParameterCollection
{
private ArrayList InternalList = new ArrayList();
/// </summary>
/// <param name="parameterName">The name of the <see cref="Npgsql.NpgsqlParameter">NpgsqlParameter</see> to retrieve.</param>
/// <value>The <see cref="Npgsql.NpgsqlParameter">NpgsqlParameter</see> with the specified name, or a null reference if the parameter is not found.</value>
+
+ #if WITHDESIGN
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ #endif
+
public NpgsqlParameter this[string parameterName] {
get
{
/// </summary>
/// <param name="index">The zero-based index of the <see cref="Npgsql.NpgsqlParameter">NpgsqlParameter</see> to retrieve.</param>
/// <value>The <see cref="Npgsql.NpgsqlParameter">NpgsqlParameter</see> at the specified index.</value>
+
+ #if WITHDESIGN
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ #endif
+
public NpgsqlParameter this[int index] {
get
{
/// <param name="parameterName">The name of the parameter.</param>
/// <param name="parameterType">One of the DbType values.</param>
/// <returns>The index of the new <see cref="Npgsql.NpgsqlParameter">NpgsqlParameter</see> object.</returns>
- public NpgsqlParameter Add(string parameterName, DbType parameterType)
+ public NpgsqlParameter Add(string parameterName, NpgsqlDbType parameterType)
{
NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "Add", parameterName, parameterType);
return this.Add(new NpgsqlParameter(parameterName, parameterType));
/// <param name="parameterType">One of the DbType values.</param>
/// <param name="size">The length of the column.</param>
/// <returns>The index of the new <see cref="Npgsql.NpgsqlParameter">NpgsqlParameter</see> object.</returns>
- public NpgsqlParameter Add(string parameterName, DbType parameterType, int size)
+ public NpgsqlParameter Add(string parameterName, NpgsqlDbType parameterType, int size)
{
NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "Add", parameterName, parameterType, size);
return this.Add(new NpgsqlParameter(parameterName, parameterType, size));
/// <param name="size">The length of the column.</param>
/// <param name="sourceColumn">The name of the source column.</param>
/// <returns>The index of the new <see cref="Npgsql.NpgsqlParameter">NpgsqlParameter</see> object.</returns>
- public NpgsqlParameter Add(string parameterName, DbType parameterType, int size, string sourceColumn)
+ public NpgsqlParameter Add(string parameterName, NpgsqlDbType parameterType, int size, string sourceColumn)
{
NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "Add", parameterName, parameterType, size, sourceColumn);
return this.Add(new NpgsqlParameter(parameterName, parameterType, size, sourceColumn));
// Iterate values to see what is the index of parameter.
Int32 index = 0;
- if (parameterName[0] != ':')
+ if ( (parameterName[0] != ':') && (parameterName[0] != '@') )
parameterName = ':' + parameterName;
foreach(NpgsqlParameter parameter in this)
/// Gets the number of <see cref="Npgsql.NpgsqlParameter">NpgsqlParameter</see> objects in the collection.
/// </summary>
/// <value>The number of <see cref="Npgsql.NpgsqlParameter">NpgsqlParameter</see> objects in the collection.</value>
+
+ #if WITHDESIGN
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ #endif
+
public int Count {
get
{