Пример #1
0
        // used by Clone() and static CreateParameter()
        internal void SetProperties(string name, string column, DataRowVersion version, byte precision, byte scale, int size, bool forceSize,
                                    int offset, ParameterDirection direction, object value, SqlDbType type, bool suppress, bool inferType)
        {
            // do limited validation here
            this.ParameterName = name;
            _sourceColumn      = column;
            SourceVersion      = version;
            Precision          = precision;
            _scale             = scale;
            _size      = size;
            _forceSize = forceSize;
            _offset    = offset;
            Direction  = direction;

            // be sure to ssync up our metaType information
            _metaType = MetaType.GetMetaType(type);

            // bug 49322, do a deep copy of object values
            if (value is ICloneable)
            {
                value = ((ICloneable)value).Clone();
            }
            _value     = value;
            Suppress   = suppress;
            _inferType = inferType;
        }
Пример #2
0
 internal void SetTypeInfoFromComType(object value)
 {
     _metaType = MetaType.GetMetaType(value);
 }
Пример #3
0
 internal void SetTypeInfoFromDbType(DbType type)
 {
     _metaType = MetaType.GetMetaType(type);
 }