示例#1
0
		internal static DataContainer Create (Type type, DataColumn column)
		{
			DataContainer container;
			switch (Type.GetTypeCode(type)) {
			case TypeCode.Int16:
				container = new Int16DataContainer ();
				break;
			case TypeCode.Int32:
				container = new Int32DataContainer ();
				break;
			case TypeCode.Int64:
				container = new Int64DataContainer ();
				break;
			case TypeCode.String:
				container = new StringDataContainer ();
				break;
			case TypeCode.Boolean:
				container = new BitDataContainer ();
				break;
			case TypeCode.Byte:
				container = new ByteDataContainer ();
				break;
			case TypeCode.Char:
				container = new CharDataContainer ();
				break;
			case TypeCode.Double:
				container = new DoubleDataContainer ();
				break;
			case TypeCode.SByte:
				container = new SByteDataContainer ();
				break;
			case TypeCode.Single:
				container = new SingleDataContainer ();
				break;
			case TypeCode.UInt16:
				container = new UInt16DataContainer ();
				break;
			case TypeCode.UInt32:
				container = new UInt32DataContainer ();
				break;
			case TypeCode.UInt64:
				container = new UInt64DataContainer ();
				break;
			case TypeCode.DateTime:
				container = new DateTimeDataContainer ();
				break;
			case TypeCode.Decimal:
				container = new DecimalDataContainer ();
				break;
			default:
				container = new ObjectDataContainer ();
				break;
			}
			container._type = type;
			container._column = column;
			return container;
		}
示例#2
0
        internal static DataContainer Create(Type type, DataColumn column)
        {
            DataContainer container;

            switch (Type.GetTypeCode(type))
            {
            case TypeCode.Int16:
                container = new Int16DataContainer();
                break;

            case TypeCode.Int32:
                container = new Int32DataContainer();
                break;

            case TypeCode.Int64:
                container = new Int64DataContainer();
                break;

            case TypeCode.String:
                container = new StringDataContainer();
                break;

            case TypeCode.Boolean:
                container = new BitDataContainer();
                break;

            case TypeCode.Byte:
                container = new ByteDataContainer();
                break;

            case TypeCode.Char:
                container = new CharDataContainer();
                break;

            case TypeCode.Double:
                container = new DoubleDataContainer();
                break;

            case TypeCode.SByte:
                container = new SByteDataContainer();
                break;

            case TypeCode.Single:
                container = new SingleDataContainer();
                break;

            case TypeCode.UInt16:
                container = new UInt16DataContainer();
                break;

            case TypeCode.UInt32:
                container = new UInt32DataContainer();
                break;

            case TypeCode.UInt64:
                container = new UInt64DataContainer();
                break;

            case TypeCode.DateTime:
                container = new DateTimeDataContainer();
                break;

            case TypeCode.Decimal:
                container = new DecimalDataContainer();
                break;

            default:
                container = new ObjectDataContainer();
                break;
            }
            container._type   = type;
            container._column = column;
            return(container);
        }