コード例 #1
0
        private static void SetData(SqlCeUpdatableRecord rec, int index, Type type, TypeConvertableWrapper col)
        {
            switch (Type.GetTypeCode(type.GetType()))
            {
            case TypeCode.String:
                rec.SetString(index, col.String);
                break;

            case TypeCode.Int16:
                rec.SetInt16(index, col.Int16);
                break;

            case TypeCode.Int32:
                rec.SetInt32(index, col.Int);
                break;

            case TypeCode.Int64:
                rec.SetInt64(index, col.Int);
                break;

            case TypeCode.Byte:
                rec.SetSqlByte(index, col.Byte);
                break;

            case TypeCode.DateTime:
                rec.SetSqlDateTime(index, col.DateTime);
                break;

            case TypeCode.Decimal:
                rec.SetDecimal(index, col.Decimal);
                break;

            default:
                throw new ArgumentException(Type.GetTypeCode(type.GetType()).ToString() + "型には対応していません。");
            }
        }