Index: System.Data.SQLite/SQLiteModule.cs ================================================================== --- System.Data.SQLite/SQLiteModule.cs +++ System.Data.SQLite/SQLiteModule.cs @@ -591,10 +591,56 @@ if (pValue == IntPtr.Zero) return null; return SQLiteBytes.FromIntPtr( UnsafeNativeMethods.sqlite3_value_blob(pValue), GetBytes()); } + + /////////////////////////////////////////////////////////////////////// + + /// + /// Gets and returns an instance associated with + /// this value. + /// + /// + /// The associated with this value. If the type + /// affinity of the object is unknown or cannot be determined, a null + /// value will be returned. + /// + public object GetObject() + { + switch (GetTypeAffinity()) + { + case TypeAffinity.Uninitialized: + { + return null; + } + case TypeAffinity.Int64: + { + return GetInt64(); + } + case TypeAffinity.Double: + { + return GetDouble(); + } + case TypeAffinity.Text: + { + return GetString(); + } + case TypeAffinity.Blob: + { + return GetBytes(); + } + case TypeAffinity.Null: + { + return DBNull.Value; + } + default: + { + return null; + } + } + } /////////////////////////////////////////////////////////////////////// /// /// Uses the native value handle to obtain and store the managed value