Esempio n. 1
0
        public Query(string CmdText, string Name, string ConnectionString)
        {
            //if (CmdText.Length == 0) { throw new Exceptions.InvalidParameterException("Command Text cannot be zero length"); }

            sqlCon = new MySqlConnection(ConnectionString);
            sqlCmd = new MySqlCommand(CmdText, sqlCon);
            parameters = new ParameterCollection();
        }
Esempio n. 2
0
        public void AddParamter(string queryName, string propertyName, ParameterCollection.FieldType type)
        {
            MappedParameter parameter = new MappedParameter();
            parameter.QueryName = queryName;
            parameter.PropertName = propertyName;
            parameter.Type = type;

            _parameters.Add(parameter);
        }
Esempio n. 3
0
        public Query(string CmdText, Transaction transaction)
        {
            if (CmdText.Length == 0) { throw new Exceptions.ErrorException("Command Text cannot be zero length"); }

            sqlCon = transaction.Connection;
            sqlTran = transaction.SqlTransaction;
            sqlCmd = new MySqlCommand(CmdText, sqlCon);
            sqlCmd.Transaction = sqlTran;

            parameters = new ParameterCollection();
        }
Esempio n. 4
0
        /// <summary>
        /// Constructor fot the parameter
        /// </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 parameter</param>
        /// <param name="Output">Determines if the parameter is of type output</param>
        public Parameter(string name, object Val, ParameterCollection.FieldType Type, bool Output)
        {
            if (name.Length == 0) { throw new Exceptions.ErrorException("Name can not be zero length"); }

            _Type = Type;
            _Name = name;
            _Value = Val;
            _Output = Output;

            SetValue();
        }