Exemplo n.º 1
0
        internal override void Bind_Text(SQLiteStatement stmt, int index, string value)
        {
            byte[] buffer    = SQLiteConvert.ToUTF8(value);
            int    errorCode = UnsafeNativeMethods.sqlite3_bind_text((IntPtr)stmt._sqlite_stmt, index, buffer, buffer.Length - 1, (IntPtr)(-1));

            if (errorCode > 0)
            {
                throw new SQLiteException(errorCode, this.SQLiteLastError());
            }
        }
Exemplo n.º 2
0
        internal override void Bind_DateTime(SQLiteStatement stmt, int index, DateTime dt)
        {
            byte[] buffer    = base.ToUTF8(dt);
            int    errorCode = UnsafeNativeMethods.sqlite3_bind_text((IntPtr)stmt._sqlite_stmt, index, buffer, buffer.Length - 1, (IntPtr)(-1));

            if (errorCode > 0)
            {
                throw new SQLiteException(errorCode, this.SQLiteLastError());
            }
        }
Exemplo n.º 3
0
        internal override void Bind_DateTime(SQLiteStatement stmt, int index, DateTime dt)
        {
            byte[] b = ToUTF8(dt);
            int    n = UnsafeNativeMethods.sqlite3_bind_text(stmt._sqlite_stmt, index, b, b.Length - 1, (IntPtr)(-1));

            if (n > 0)
            {
                throw new SQLiteException(n, SQLiteLastError());
            }
        }