public Cursor <tRow> Cursor <tRow>(bool bReadOnly) where tRow : new() { sTable tbl = findTable(typeof(tRow)); if (tbl.bIsReadonly && (!bReadOnly)) { throw new NotSupportedException("Can't provide read-write access to the table that was opened as read-only."); } return(new Cursor <tRow>(this, tbl.serializer, tbl.idTable, bReadOnly)); }
public bool addType(TypeSerializer ts, bool bOpenAsReadonly) { Type t = ts.recordType; sTable tmp; if (m_tables.TryGetValue(t, out tmp)) { return(false); } // throw new SerializationException( " The table for type '" + t.Name + "' is already opened." ); ts.VerifyTableSchema(m_idSession, m_idDatabase); OpenTableGrbit flags = (bOpenAsReadonly) ? OpenTableGrbit.ReadOnly : OpenTableGrbit.None; JET_TABLEID idTable; Api.JetOpenTable(m_idSession, m_idDatabase, ts.tableName, null, 0, flags, out idTable); m_tables[t] = new sTable(idTable, bOpenAsReadonly, ts); return(true); }
public Cursor <tRow> Cursor <tRow>() where tRow : new() { sTable tbl = findTable(typeof(tRow)); return(new Cursor <tRow>(this, tbl.serializer, tbl.idTable, tbl.bIsReadonly)); }