public virtual object GetColumnValue(int index) { CheckDisposed(); object value; SQLiteColumnType type = GetColumnType(index); switch (type) { case SQLiteColumnType.BLOB: byte[] bytes = GetColumnByteArray(index); value = bytes; break; case SQLiteColumnType.TEXT: string s = GetColumnString(index); value = s; break; case SQLiteColumnType.REAL: double d = GetColumnDouble(index); value = d; break; case SQLiteColumnType.INTEGER: long l = GetColumnInt64(index); if (l >= int.MinValue && l <= int.MaxValue) { value = (int)l; } else { value = l; } break; //case SQLiteColumnType.SQLITE_NULL: default: value = null; break; } return(value); }
/// <summary>名前と型を指定して列を加える</summary> public void AddColumn(string name, SQLiteColumnType type, object [] values = null) { this.AddColumn(new ColumnDefinition(name, type), values); }
/// <summary>要素を指定して生成</summary> public ColumnDefinition(string name, SQLiteColumnType type) { this.Name = name; this.Type = type; }