コード例 #1
0
 public SQLParamName[] GetAllParamaters()
 {
     SQLParamName[] parameters = new SQLParamName[parameterList.Count];
     for (int i = 0; i < parameters.Length; i++)
     {
         parameters[i] = parameterList.Values.ElementAt(i);
     }
     return(parameters);
 }
コード例 #2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (this == obj)
            {
                return(true);
            }
            if (obj.GetType() != typeof(SQLParamName))
            {
                return(false);
            }
            SQLParamName comp = (SQLParamName)obj;

            if (this.Name != comp.Name)
            {
                return(false);
            }
            if (this.Parent != comp.Parent)
            {
                return(false);
            }
            if (this.ID != comp.ID)
            {
                return(false);
            }
            if (this.ParamType != comp.ParamType)
            {
                return(false);
            }
            if (this.MaximumLength != comp.MaximumLength)
            {
                return(false);
            }
            if (this.Precision != comp.Precision)
            {
                return(false);
            }
            if (this.Scale != comp.Scale)
            {
                return(false);
            }
            if (this.Collation != comp.Collation)
            {
                return(false);
            }
            if (this.Optional != comp.Optional)
            {
                return(false);
            }

            return(true);
        }
コード例 #3
0
        public override SQLParamName[] GenerateSQLParams(DataRow[] dt)
        {
            SQLParamName[] SQLparameters = new SQLParamName[dt.Length];
            for (int i = 0; i < dt.Length; i++)
            {
                DataRow      dr    = dt[i];
                SQLParamName param = new SQLParamName();

                param.Name          = (string)dr.ItemArray[2];
                param.Parent        = this;
                param.ID            = (int)dr.ItemArray[3];
                param.ParamType     = GetSqlTypeFromString((string)dr.ItemArray[4]);
                param.MaximumLength = Convert.ToDouble(dr.ItemArray[5]);
                param.Precision     = (int)dr.ItemArray[6];

                if (dr.ItemArray[7].GetType() == typeof(int))
                {
                    param.Scale = (int)dr.ItemArray[7];
                }
                else
                {
                    param.Scale = -1;
                }

                if (dr.ItemArray[8].GetType() == typeof(DBNull))
                {
                    param.Collation = null;
                }
                else
                {
                    param.Collation = (string)dr.ItemArray[8];
                }

                param.Optional = IsParamOptional(param.Name);

                param.MakeFinal();
                SQLparameters[i] = param;
            }
            return(SQLparameters);
        }