Ejemplo n.º 1
0
        /// <summary>
        /// Widen datatype
        /// </summary>
        /// <param name="one">Datatype one</param>
        /// <param name="two">Datatype two</param>
        /// <returns>Widened datatype</returns>
        private DataType Widen(DataType one, DataType two)
        {
            OleDbType type = DataType.CommonType(one.Type, two.Type);

            one.Type      = type;
            one.Length    = Math.Max(one.Length.GetValueOrDefault(0), two.Length.GetValueOrDefault(0));
            one.Precision = Math.Max(one.Precision.GetValueOrDefault(0), two.Precision.GetValueOrDefault(0));
            one.Scale     = Math.Max(one.Scale.GetValueOrDefault(0), two.Scale.GetValueOrDefault(0));

            return(one);
        }