Example #1
0
        public void AddNullValuePara(string Name, QueryParameterDirection Direction)
        {
            SqlParameter oPara = new SqlParameter(Name, DBNull.Value);

            oPara.Direction = GetParaType(Direction);
            this.oParameters.Add(oPara);
        }
Example #2
0
        /// <summary>
        /// Adds a Structured type query parameter with
        /// the given direction type.
        /// </summary>
        /// <param name="Name">Name of the parameter.</param>
        /// <param name="Value">Value of the parameter.</param>
        /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
        public void AddStructuredPara(string Name, DataTable oValue, QueryParameterDirection Direction)
        {
            SqlParameter oPara = new SqlParameter(Name, SqlDbType.Structured);

            oPara.Direction = GetParaType(Direction);
            oPara.Value     = oValue;
            this.oParameters.Add(oPara);
        }
Example #3
0
        public void AddBigIntegerNullPara(string Name, QueryParameterDirection Direction)
        {
            SqlParameter oPara = new SqlParameter(Name, SqlDbType.Int);

            oPara.Direction = GetParaType(Direction);
            oPara.Value     = DBNull.Value;
            this.oParameters.Add(oPara);
        }
Example #4
0
        /// <summary>
        /// Adds a Binary type query parameter with
        /// the given direction type.
        /// </summary>
        /// <param name="Name">Name of the parameter.</param>
        /// <param name="Value">Value of the parameter.</param>
        /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
        public void AddVarBinaryPara(string Name, byte[] oValue, QueryParameterDirection Direction)
        {
            SqlParameter oPara = new SqlParameter(Name, SqlDbType.VarBinary);

            oPara.Direction = GetParaType(Direction);
            oPara.Value     = oValue;
            this.oParameters.Add(oPara);
        }
Example #5
0
        /// <summary>
        /// Adds the float para.
        /// </summary>
        /// <param name="Name">The name.</param>
        /// <param name="Value">The value.</param>
        /// <param name="Direction">The direction.</param>
        /// <author>Debajit Mukhopadhyay</author>
        /// <createdDate>19-Oct-09</createdDate>
        public void AddFloatPara(string Name, float Value, QueryParameterDirection Direction)
        {
            SqlParameter oPara = new SqlParameter(Name, SqlDbType.Decimal);

            oPara.Direction = GetParaType(Direction);
            oPara.Value     = Value;
            this.oParameters.Add(oPara);
        }
        /// <summary>
        /// Adds an Integer type query parameter with
        /// the given direction type.
        /// </summary>
        /// <param name="Name">Name of the parameter.</param>
        /// <param name="Value">Value of the parameter.</param>
        /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
        public void AddIntegerPara(string Name, int Value, QueryParameterDirection Direction)
        {
            OleDbParameter oPara = new OleDbParameter(Name, OleDbType.Integer);

            oPara.Direction = GetParaType(Direction);
            oPara.Value     = Value;
            this.oParameters.Add(oPara);
        }
Example #7
0
        public void AddBooleanPara(string Name, bool Value, QueryParameterDirection Direction)
        {
            SqlParameter oPara = new SqlParameter(Name, SqlDbType.Bit);

            oPara.Direction = GetParaType(Direction);
            oPara.Value     = Value;
            this.oParameters.Add(oPara);
        }
Example #8
0
        public void AddDateTimePara(string Name, DateTime Value, QueryParameterDirection Direction)
        {
            SqlParameter oPara = new SqlParameter(Name, SqlDbType.DateTime);

            oPara.Direction = GetParaType(Direction);
            oPara.Value     = Value;
            this.oParameters.Add(oPara);
        }
Example #9
0
        /// <summary>
        /// Adds an Integer type query parameter with
        /// the given direction type.
        /// </summary>
        /// <param name="Name">Name of the parameter.</param>
        /// <param name="Value">Value of the parameter.</param>
        /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
        public void AddIntegerBigPara(string Name, Int64 Value, QueryParameterDirection Direction)
        {
            SqlParameter oPara = new SqlParameter(Name, SqlDbType.BigInt);

            oPara.Direction = GetParaType(Direction);
            oPara.Value     = Value;
            this.oParameters.Add(oPara);
        }
Example #10
0
        /// <summary>
        /// Adds a Structured type query parameter with
        /// the given direction type.
        /// </summary>
        /// <param name="Name">Name of the parameter.</param>
        /// <param name="Value">Value of the parameter.</param>
        /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
        public void AddStructuredPara(string Name, DataTable oValue, QueryParameterDirection Direction)
        {
            OleDbParameter oPara = new OleDbParameter(Name, OleDbType.PropVariant);

            oPara.Direction = GetParaType(Direction);
            oPara.Value     = oValue;
            this.oParameters.Add(oPara);
        }
Example #11
0
        /// <summary>
        /// Adds a Varchar type query parameter with
        /// the given direction type.
        /// </summary>
        /// <param name="Name">Name of the parameter.</param>
        /// <param name="Size">Size of the parameter.</param>
        /// <param name="Value">Value of the parameter.</param>
        /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
        public void AddGuidPara(string Name, string Value, QueryParameterDirection Direction)
        {
            object oValue = (object)Value;

            if (Value == null)
            {
                oValue = DBNull.Value;
            }
            SqlCeParameter oPara = new SqlCeParameter(Name, SqlDbType.Char, 38);

            oPara.Direction = GetParaType(Direction);
            oPara.Value     = oValue;
            this.oParameters.Add(oPara);
        }
Example #12
0
        /// <summary>
        /// Adds a Char type query parameter with
        /// the given direction type.
        /// </summary>
        /// <param name="Name">Name of the parameter.</param>
        /// <param name="Size">Size of the parameter.</param>
        /// <param name="Value">Value of the parameter.</param>
        /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
        public void AddCharPara(string Name, int Size, char Value, QueryParameterDirection Direction)
        {
            object oValue = (object)Value;

            if (Value.Equals(null))
            {
                oValue = DBNull.Value;
            }
            SqlCeParameter oPara = new SqlCeParameter(Name, SqlDbType.Char, Size);

            oPara.Direction = GetParaType(Direction);
            oPara.Value     = oValue;
            this.oParameters.Add(oPara);
        }
Example #13
0
        /// <summary>
        /// Adds a Clob type query parameter with
        /// the given direction type.
        /// </summary>
        /// <param name="Name">Name of the parameter.</param>
        /// <param name="Size">Size of the parameter.</param>
        /// <param name="Value">Value of the parameter.</param>
        /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
        public void AddImagePara(string Name, String Value, QueryParameterDirection Direction)
        {
            object oValue = (object)Value;

            if (Value == null)
            {
                oValue = DBNull.Value;
            }
            OleDbParameter oPara = new OleDbParameter(Name, OleDbType.Binary);

            oPara.Direction = GetParaType(Direction);
            oPara.Value     = oValue;
            this.oParameters.Add(oPara);
        }
Example #14
0
        public void AddNVarcharPara(string Name, int Size, string Value, QueryParameterDirection Direction)
        {
            object oValue = (object)Value;

            if (Value == null)
            {
                oValue = DBNull.Value;
            }
            SqlParameter oPara = new SqlParameter(Name, SqlDbType.NVarChar, Size);

            oPara.Direction = GetParaType(Direction);
            oPara.Value     = oValue;
            this.oParameters.Add(oPara);
        }
Example #15
0
        public void AddImagePara(string Name, byte[] Value, QueryParameterDirection Direction)
        {
            object oValue = (object)Value;

            if (Value == null)
            {
                oValue = DBNull.Value;
            }
            SqlParameter oPara = new SqlParameter(Name, SqlDbType.Image);

            oPara.Direction = GetParaType(Direction);
            oPara.Value     = oValue;
            this.oParameters.Add(oPara);
        }
Example #16
0
        /// <summary>
        /// Adds a Timestamp type query parameter with
        /// the given direction type.
        /// </summary>
        /// <param name="Name">Name of the parameter.</param>
        /// <param name="Value">Value of the parameter.</param>
        /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
        public void AddTimeStampPara(string Name, System.Byte[] Value, QueryParameterDirection Direction)
        {
            object oValue = (object)Value;

            if (Value == null)
            {
                oValue = DBNull.Value;
            }
            SqlParameter oPara = new SqlParameter(Name, SqlDbType.Timestamp);

            oPara.Direction = GetParaType(Direction);
            oPara.Value     = oValue;
            this.oParameters.Add(oPara);
        }
Example #17
0
        private ParameterDirection GetParaType(QueryParameterDirection Direction)
        {
            switch (Direction)
            {
            case QueryParameterDirection.Output:
                return(ParameterDirection.InputOutput);

            case QueryParameterDirection.Return:
                return(ParameterDirection.ReturnValue);

            default:
                return(ParameterDirection.Input);
            }
        }
Example #18
0
        /// <summary>
        /// Adds an Integer type query parameter with
        /// the given direction type.
        /// </summary>
        /// <param name="Name">Name of the parameter.</param>
        /// <param name="Value">Value of the parameter.</param>
        /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
        public void AddIntegerPara(string Name, int?Value, QueryParameterDirection Direction)
        {
            OleDbParameter oPara = new OleDbParameter(Name, OleDbType.Integer);

            oPara.Direction = GetParaType(Direction);
            if (Value == null)
            {
                oPara.Value = DBNull.Value;
            }
            else
            {
                oPara.Value = Value;
            }
            this.oParameters.Add(oPara);
        }
Example #19
0
        /// <summary>
        /// Adds an Integer type query parameter with
        /// the given direction type.
        /// </summary>
        /// <param name="Name">Name of the parameter.</param>
        /// <param name="Value">Value of the parameter.</param>
        /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
        public void AddIntegerBigPara(string Name, Int64?Value, QueryParameterDirection Direction)
        {
            SqlParameter oPara = new SqlParameter(Name, SqlDbType.BigInt);

            oPara.Direction = GetParaType(Direction);
            if (Value == null)
            {
                oPara.Value = DBNull.Value;
            }
            else
            {
                oPara.Value = Value;
            }
            this.oParameters.Add(oPara);
        }
Example #20
0
        public void AddDateTimePara(string Name, DateTime?Value, QueryParameterDirection Direction)
        {
            SqlParameter oPara = new SqlParameter(Name, SqlDbType.DateTime);

            oPara.Direction = GetParaType(Direction);
            if (Value == null)
            {
                oPara.Value = DBNull.Value;
            }
            else
            {
                oPara.Value = Value;
            }
            this.oParameters.Add(oPara);
        }
Example #21
0
        /// <summary>
        /// Adds the float para.
        /// </summary>
        /// <param name="Name">The name.</param>
        /// <param name="Value">The value.</param>
        /// <param name="Direction">The direction.</param>
        /// <author>Debajit Mukhopadhyay</author>
        /// <createdDate>19-Oct-09</createdDate>
        public void AddFloatPara(string Name, float?Value, QueryParameterDirection Direction)
        {
            SqlCeParameter oPara = new SqlCeParameter(Name, SqlDbType.Decimal);

            oPara.Direction = GetParaType(Direction);
            if (Value == null)
            {
                oPara.Value = DBNull.Value;
            }
            else
            {
                oPara.Value = Value;
            }
            this.oParameters.Add(oPara);
        }
Example #22
0
        /// <summary>
        /// Adds a NVarchar type query parameter with
        /// the given direction type.
        /// </summary>
        /// <param name="Name">Name of the parameter.</param>
        /// <param name="Size">Size of the parameter.</param>
        /// <param name="Value">Value of the parameter.</param>
        /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
        public void AddNVarcharParam(string Name, int Size, string Value, QueryParameterDirection Direction)
        {
            SqlParameter oPara = new SqlParameter(Name, SqlDbType.NVarChar, Size);

            oPara.Direction = GetParaType(Direction);

            if (null != Value)
            {
                oPara.Value = Value;
            }
            else
            {
                oPara.Value = DBNull.Value;
            }

            this.m_oParameters.Add(oPara);
        }
Example #23
0
        /// <summary>
        /// Adds a DateTime type query parameter with
        /// the given direction type.
        /// </summary>
        /// <param name="Name">Name of the parameter.</param>
        /// <param name="Value">Value of the parameter.</param>
        /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
        public void AddDateTimeParam(string Name, Nullable <DateTime> Value, QueryParameterDirection Direction)
        {
            SqlParameter oPara = new SqlParameter(Name, SqlDbType.DateTime);

            oPara.Direction = GetParaType(Direction);

            if (Value.HasValue)
            {
                oPara.Value = Value;
            }
            else
            {
                oPara.Value = DBNull.Value;
            }

            this.m_oParameters.Add(oPara);
        }
Example #24
0
        /// <summary>
        /// Adds an Big Integer type query parameter with
        /// the given direction type.
        /// </summary>
        /// <param name="Name">Name of the parameter.</param>
        /// <param name="Value">Value of the parameter.</param>
        /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
        public void AddBigIntegerParam(string Name, Nullable <Int64> Value, QueryParameterDirection Direction)
        {
            SqlParameter oPara = new SqlParameter(Name, SqlDbType.BigInt);

            oPara.Direction = GetParaType(Direction);

            if (Value.HasValue)
            {
                oPara.Value = Value;
            }
            else
            {
                oPara.Value = DBNull.Value;
            }

            this.m_oParameters.Add(oPara);
        }
Example #25
0
        /// <summary>
        /// Adds an Image type query parameter with
        /// the given direction type.
        /// </summary>
        /// <param name="Name">Name of the parameter.</param>
        /// <param name="Value">Value of the parameter.</param>
        /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
        public void AddImageParam(string Name, byte[] Value, QueryParameterDirection Direction)
        {
            SqlParameter oPara = new SqlParameter(Name, SqlDbType.Image);

            oPara.Direction = GetParaType(Direction);

            if (null != Value)
            {
                oPara.Value = Value;
            }
            else
            {
                oPara.Value = DBNull.Value;
            }

            this.m_oParameters.Add(oPara);
        }
Example #26
0
        /// <summary>
        /// Adds a NChar type query parameter with
        /// the given direction type.
        /// </summary>
        /// <param name="Name">Name of the parameter.</param>
        /// <param name="Size">Size of the parameter.</param>
        /// <param name="Value">Value of the parameter.</param>
        /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
        public void AddNCharParam(string Name, int Size, Nullable <char> Value, QueryParameterDirection Direction)
        {
            SqlParameter oPara = new SqlParameter(Name, SqlDbType.NChar, Size);

            oPara.Direction = GetParaType(Direction);

            if (Value.HasValue)
            {
                oPara.Value = Value;
            }
            else
            {
                oPara.Value = DBNull.Value;
            }

            this.m_oParameters.Add(oPara);
        }
Example #27
0
        /// <summary>
        /// Adds a Varchar type query parameter with
        /// the given direction type.
        /// </summary>
        /// <param name="Name">Name of the parameter.</param>
        /// <param name="Size">Size of the parameter.</param>
        /// <param name="Value">Value of the parameter.</param>
        /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
        public void AddVarcharPara(string Name, int Size, string Value, QueryParameterDirection Direction)
        {
            object oValue = (object)Value;

            if (Value == null)
            {
                oValue = DBNull.Value;
            }
            else if (Value.Length == 0)
            {
                oValue = DBNull.Value;
            }
            OleDbParameter oPara = new OleDbParameter(Name, OleDbType.VarChar, Size);

            oPara.Direction = GetParaType(Direction);
            oPara.Value     = oValue;
            this.oParameters.Add(oPara);
        }
Example #28
0
 /// <summary>
 /// Adds a Structured type query parameter with
 /// the given direction type. 
 /// </summary>
 /// <param name="Name">Name of the parameter.</param>
 /// <param name="Value">Value of the parameter.</param>
 /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
 public void AddStructuredPara(string Name, DataTable oValue, QueryParameterDirection Direction)
 {
     SqlParameter oPara = new SqlParameter(Name, SqlDbType.Structured);
     oPara.Direction = GetParaType(Direction);
     oPara.Value = oValue;
     this.oParameters.Add(oPara);
 }
Example #29
0
 /// <summary>
 /// Adds a Varchar type query parameter with
 /// the given direction type. 
 /// </summary>
 /// <param name="Name">Name of the parameter.</param>
 /// <param name="Size">Size of the parameter.</param>
 /// <param name="Value">Value of the parameter.</param>
 /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
 public void AddGuidPara(string Name, string Value, QueryParameterDirection Direction)
 {
     object oValue = (object)Value;
     if (Value == null)
     {
         oValue = DBNull.Value;
     }
     OleDbParameter oPara = new OleDbParameter(Name,OleDbType.Char,38);
     oPara.Direction = GetParaType(Direction);
     oPara.Value = oValue;
     this.oParameters.Add(oPara);
 }
Example #30
0
        public void AddDecimalPara(string Name, byte Scale, byte Precision, decimal Value, QueryParameterDirection Direction)
        {
            SqlParameter oPara = new SqlParameter(Name, SqlDbType.Decimal);

            oPara.Scale     = Scale;
            oPara.Precision = Precision;
            oPara.Direction = GetParaType(Direction);
            oPara.Value     = Value;
            this.oParameters.Add(oPara);
        }
Example #31
0
 /// <summary>
 /// Adds a Structured type query parameter with
 /// the given direction type. 
 /// </summary>
 /// <param name="Name">Name of the parameter.</param>
 /// <param name="Value">Value of the parameter.</param>
 /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
 public void AddStructuredPara(string Name, DataTable oValue, QueryParameterDirection Direction)
 {
     OleDbParameter oPara = new OleDbParameter(Name, OleDbType.PropVariant);
     oPara.Direction = GetParaType(Direction);
     oPara.Value = oValue;
     this.oParameters.Add(oPara);
 }
Example #32
0
        /// <summary>
        /// Adds the float para.
        /// </summary>
        /// <param name="Name">The name.</param>
        /// <param name="Value">The value.</param>
        /// <param name="Direction">The direction.</param>
        /// <author>Debajit Mukhopadhyay</author>
        /// <createdDate>19-Oct-09</createdDate>
        public void AddFloatPara(string Name, float? Value, QueryParameterDirection Direction)
        {
            SqlCeParameter oPara = new SqlCeParameter(Name, SqlDbType.Decimal);

            oPara.Direction = GetParaType(Direction);
            if (Value == null)
                oPara.Value = DBNull.Value;
            else
                oPara.Value = Value;
            this.oParameters.Add(oPara);
        }
Example #33
0
 /// <summary>
 /// Adds a Varchar type query parameter with
 /// the given direction type. 
 /// </summary>
 /// <param name="Name">Name of the parameter.</param>
 /// <param name="Size">Size of the parameter.</param>
 /// <param name="Value">Value of the parameter.</param>
 /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
 public void AddVarcharPara(string Name, int Size, string Value, QueryParameterDirection Direction)
 {
     object oValue = (object)Value;
     if (Value == null)
     {
         oValue = DBNull.Value;
     }
     else if (Value.Length == 0)
     {
         oValue = DBNull.Value;
     }
     SqlParameter oPara = new SqlParameter(Name, SqlDbType.VarChar, Size);
     oPara.Direction = GetParaType(Direction);
     oPara.Value = oValue;
     this.oParameters.Add(oPara);
 }
Example #34
0
 /// <summary>
 /// Adds a DateTime type query parameter with
 /// the given direction type. 
 /// </summary>
 /// <param name="Name">Name of the parameter.</param>
 /// <param name="Value">Value of the parameter.</param>
 /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
 public void AddDateTimePara(string Name, DateTime Value, QueryParameterDirection Direction)
 {
     SqlParameter oPara = new SqlParameter(Name, SqlDbType.DateTime);
     oPara.Direction = GetParaType(Direction);
     oPara.Value = Value;
     this.oParameters.Add(oPara);
 }
Example #35
0
 /// <summary>
 /// Adds a Char type query parameter with
 /// the given direction type. 
 /// </summary>
 /// <param name="Name">Name of the parameter.</param>
 /// <param name="Size">Size of the parameter.</param>
 /// <param name="Value">Value of the parameter.</param>
 /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
 public void AddCharPara(string Name, int Size, char Value, QueryParameterDirection Direction)
 {
     object oValue = (object)Value;
     if (Value.Equals(null))
     {
         oValue = DBNull.Value;
     }
     SqlParameter oPara = new SqlParameter(Name, SqlDbType.Char, Size);
     oPara.Direction = GetParaType(Direction);
     oPara.Value = oValue;
     this.oParameters.Add(oPara);
 }
Example #36
0
        /// <summary>
        /// Adds a Decimal type query parameter with
        /// the given direction type.
        /// </summary>
        /// <param name="Name">Name of the parameter.</param>
        /// <param name="Precision">Precision of the decimal number</param>
        /// <param name="Scale">Scale of the decimal number</param>
        /// <param name="Value">Value of the parameter.</param>
        /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
        public void AddDecimalParam(string Name, byte Precision, byte Scale, Nullable <decimal> Value, QueryParameterDirection Direction)
        {
            SqlParameter oPara = new SqlParameter(Name, SqlDbType.Decimal);

            oPara.Direction = GetParaType(Direction);

            oPara.Precision = Precision;
            oPara.Scale     = Scale;

            if (Value.HasValue)
            {
                oPara.Value = Value;
            }
            else
            {
                oPara.Value = DBNull.Value;
            }

            this.m_oParameters.Add(oPara);
        }
Example #37
0
 /// <summary>
 /// Adds a Decimal type query parameter with
 /// the given direction type. 
 /// </summary>
 /// <param name="Name">Name of the parameter.</param>
 /// <param name="Scale">Scale of the decimal number</param>
 /// <param name="Precision">Precision of the decimal number</param>
 /// <param name="Value">Value of the parameter.</param>
 /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
 public void AddDecimalPara(string Name, byte Scale, byte Precision, decimal? Value, QueryParameterDirection Direction)
 {
     OleDbParameter oPara = new OleDbParameter(Name, OleDbType.Decimal);
     oPara.Precision = Precision;
     oPara.Scale = Scale;
     oPara.Direction = GetParaType(Direction);
     if (Value == null)
         oPara.Value = DBNull.Value;
     else
         oPara.Value = Value;
     this.oParameters.Add(oPara);
 }
Example #38
0
 /// <summary>
 /// Adds a Timestamp type query parameter with
 /// the given direction type. 
 /// </summary>
 /// <param name="Name">Name of the parameter.</param>
 /// <param name="Value">Value of the parameter.</param>
 /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
 public void AddTimeStampPara(string Name, System.Byte[] Value, QueryParameterDirection Direction)
 {
     object oValue = (object)Value;
     if (Value == null)
     {
         oValue = DBNull.Value;
     }
     SqlParameter oPara = new SqlParameter(Name, SqlDbType.Timestamp);
     oPara.Direction = GetParaType(Direction);
     oPara.Value = oValue;
     this.oParameters.Add(oPara);
 }
Example #39
0
 /// <summary>
 /// Adds a Binary type query parameter with
 /// the given direction type. 
 /// </summary>
 /// <param name="Name">Name of the parameter.</param>
 /// <param name="Value">Value of the parameter.</param>
 /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
 public void AddVarBinaryPara(string Name, byte[] oValue, QueryParameterDirection Direction)
 {
     SqlParameter oPara = new SqlParameter(Name, SqlDbType.VarBinary);
     oPara.Direction = GetParaType(Direction);
     oPara.Value = oValue;
     this.oParameters.Add(oPara);
 }
Example #40
0
 /// <summary>
 /// Adds a Decimal type query parameter with
 /// the given direction type. 
 /// </summary>
 /// <param name="Name">Name of the parameter.</param>
 /// <param name="Scale">Scale of the decimal number</param>
 /// <param name="Precision">Precision of the decimal number</param>
 /// <param name="Value">Value of the parameter.</param>
 /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
 public void AddDecimalPara(string Name, byte Scale, byte Precision, decimal Value, QueryParameterDirection Direction)
 {
     SqlParameter oPara = new SqlParameter(Name, SqlDbType.Decimal);
     oPara.Scale = Scale;
     oPara.Precision = Precision;
     oPara.Direction = GetParaType(Direction);
     oPara.Value = Value;
     this.oParameters.Add(oPara);
 }
Example #41
0
 /// <summary>
 /// Converts parameter direction enum to the underlying sql type
 /// </summary>
 /// <param name="Direction">Enum value to convert</param>
 /// <returns>Underlying SqlClient value corresponding to the passed Enum</returns>
 private ParameterDirection GetParaType(QueryParameterDirection Direction)
 {
     switch (Direction)
     {
         case QueryParameterDirection.Output:
             return ParameterDirection.InputOutput;
         case QueryParameterDirection.Return:
             return ParameterDirection.ReturnValue;
         case QueryParameterDirection.InputOutput:
             return ParameterDirection.InputOutput;
         default:
             return ParameterDirection.Input;
     }
 }
Example #42
0
        /// <summary>
        /// Adds the float para.
        /// </summary>
        /// <param name="Name">The name.</param>
        /// <param name="Value">The value.</param>
        /// <param name="Direction">The direction.</param>
        /// <author>Debajit Mukhopadhyay</author>
        /// <createdDate>19-Oct-09</createdDate>
        public void AddFloatPara(string Name, float Value, QueryParameterDirection Direction)
        {
            SqlParameter oPara = new SqlParameter(Name, SqlDbType.Decimal);

            oPara.Direction = GetParaType(Direction);
            oPara.Value = Value;
            this.oParameters.Add(oPara);
        }
Example #43
0
 /// <summary>
 /// Adds a Clob type query parameter with
 /// the given direction type. 
 /// </summary>
 /// <param name="Name">Name of the parameter.</param>
 /// <param name="Size">Size of the parameter.</param>
 /// <param name="Value">Value of the parameter.</param>
 /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
 public void AddImagePara(string Name, String Value, QueryParameterDirection Direction)
 {
     object oValue = (object)Value;
     if (Value == null)
     {
         oValue = DBNull.Value;
     }
     SqlParameter oPara = new SqlParameter(Name, SqlDbType.Image);
     oPara.Direction = GetParaType(Direction);
     oPara.Value = oValue;
     this.oParameters.Add(oPara);
 }
Example #44
0
 /// <summary>
 /// Adds an Integer type query parameter with
 /// the given direction type. 
 /// </summary>
 /// <param name="Name">Name of the parameter.</param>
 /// <param name="Value">Value of the parameter.</param>
 /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
 public void AddIntegerBigPara(string Name, Int64 Value, QueryParameterDirection Direction)
 {
     SqlParameter oPara = new SqlParameter(Name, SqlDbType.BigInt);
     oPara.Direction = GetParaType(Direction);
     oPara.Value = Value;
     this.oParameters.Add(oPara);
 }
Example #45
0
 /// <summary>
 /// Adds an Integer type query parameter with
 /// the given direction type. 
 /// </summary>
 /// <param name="Name">Name of the parameter.</param>
 /// <param name="Value">Value of the parameter.</param>
 /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
 public void AddIntegerPara(string Name, int Value, QueryParameterDirection Direction)
 {
     OleDbParameter oPara = new OleDbParameter(Name, OleDbType.Integer);
     oPara.Direction = GetParaType(Direction);
     oPara.Value = Value;
     this.oParameters.Add(oPara);
 }
Example #46
0
 /// <summary>
 /// Adds an Integer type query parameter with
 /// the given direction type. 
 /// </summary>
 /// <param name="Name">Name of the parameter.</param>
 /// <param name="Value">Value of the parameter.</param>
 /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
 public void AddIntegerPara(string Name, int? Value, QueryParameterDirection Direction)
 {
     SqlParameter oPara = new SqlParameter(Name, SqlDbType.Int);
     oPara.Direction = GetParaType(Direction);
     if (Value == null)
         oPara.Value = DBNull.Value;
     else
         oPara.Value = Value;
     this.oParameters.Add(oPara);
 }
Example #47
0
 /// <summary>
 /// Adds an Integer type query parameter with
 /// the given direction type. 
 /// </summary>
 /// <param name="Name">Name of the parameter.</param>
 /// <param name="Value">Value of the parameter.</param>
 /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
 public void AddIntegerBigPara(string Name, Int64? Value, QueryParameterDirection Direction)
 {
     OleDbParameter oPara = new OleDbParameter(Name, OleDbType.BigInt);
     oPara.Direction = GetParaType(Direction);
     if (Value == null)
         oPara.Value = DBNull.Value;
     else
         oPara.Value = Value;
     this.oParameters.Add(oPara);
 }
Example #48
0
 /// <summary>
 /// Adds a NULL value query parameter with Parameter Direction
 /// </summary>
 /// <param name="Name">Name of parameter</param>
 /// <param name="Direction">Parameter Direction</param>
 public void AddNullValuePara(string Name, QueryParameterDirection Direction)
 {
     SqlParameter oPara = new SqlParameter(Name, DBNull.Value);
     oPara.Direction = GetParaType(Direction);
     this.oParameters.Add(oPara);
 }
Example #49
0
 public void AddDateTimePara(string Name, DateTime? Value, QueryParameterDirection Direction)
 {
     OleDbParameter oPara = new OleDbParameter(Name, OleDbType.Date);
     oPara.Direction = GetParaType(Direction);
     if (Value == null)
         oPara.Value = DBNull.Value;
     else
         oPara.Value = Value;
     this.oParameters.Add(oPara);
 }
Example #50
0
        /// <summary>
        /// Adds a Decimal type query parameter with
        /// the given direction type.
        /// </summary>
        /// <param name="Name">Name of the parameter.</param>
        /// <param name="Scale">Scale of the decimal number</param>
        /// <param name="Precision">Precision of the decimal number</param>
        /// <param name="Value">Value of the parameter.</param>
        /// <param name="Direction">Parameter Direction: Input/ Output/ Return</param>
        public void AddDecimalPara(string Name, byte Scale, byte Precision, decimal?Value, QueryParameterDirection Direction)
        {
            SqlCeParameter oPara = new SqlCeParameter(Name, SqlDbType.Decimal);

            oPara.Precision = Precision;
            oPara.Scale     = Scale;
            oPara.Direction = GetParaType(Direction);
            if (Value == null)
            {
                oPara.Value = DBNull.Value;
            }
            else
            {
                oPara.Value = Value;
            }
            this.oParameters.Add(oPara);
        }