// this implementation of a sqlite rowlist is only appropriate if there is
        // a bind parameter which will return a result for every row.  unless you
        // don't mind empty rows in the grid, gaps where nothing is displayed.
        // however, this will be much faster than the IEnumish one, and doesn't
        // require a cache in front of it.

        public bool get_value(int row, out TRow val)
        {
            // TODO or should the reset be done AFTER?
            _stmt.reset();

            _stmt.clear_bindings();              // TODO probably not safe to clear bindings here because we only own one of them

            _stmt.bind_int(1, row);              // TODO the ndx of the bind param should be a param to the constructor of this class

            int rc = _stmt.step();

            if (raw.SQLITE_ROW != rc)
            {
                val = default(TRow);
                return(false);
            }

            val = get_row();
            return(true);
        }
Exemple #2
0
 public static void bind(this sqlite3_stmt stmt, int ndx, int v)
 {
     stmt.bind_int(ndx, v);
 }