If I use SQLiteParameter("@FRN", DbType.UInt64) for INSERT/UPDATE I get
System.OverflowException: Der Wert für einen Int64 war zu groß oder zu klein.
bei System.Convert.ToInt64(UInt64 value)
bei System.UInt64.System.IConvertible.ToInt64(IFormatProvider provider)
bei System.Convert.ToInt64(Object value, IFormatProvider provider)
bei System.Data.SQLite.SQLiteStatement.BindParameter(Int32 index, SQLiteParameter param)
bei System.Data.SQLite.SQLiteStatement.BindParameters()
bei System.Data.SQLite.SQLiteCommand.GetStatement(Int32 index)
bei System.Data.SQLite.SQLiteCommand.ExecuteNonQuery()
Also, even if I disable Overflow checking in compiler, the cast still needs some time, I have around one million records, so I would like to have a "native" way.
I understand your argument that there is no DataReader.GetUInt64... at the moment I don't see a solution either. Maybe provide a derived DataReader with GetUInt64, .....
The only thing I know is that if you declare a C function like this
---------------------
[DllImport(SQLITE_DLL)]
internal static extern void sqlite3_column_int64_interop(IntPtr stmt, int index, out long value);
[DllImport(SQLITE_DLL)]
internal static extern void sqlite3_column_int64_interop(IntPtr stmt, int index, out ulong value);
-----------------
you can call this function with ulong and long without any casting, the marshaling just copies the bytes to and from the original long. And this is the fastest way.