public XbimGeometryCursor(EsentModel model, string database, OpenDatabaseGrbit mode) : base(model, database, mode) { Api.JetOpenTable(Sesid, DbId, GeometryTableName, null, 0, mode == OpenDatabaseGrbit.ReadOnly ? OpenTableGrbit.ReadOnly : mode == OpenDatabaseGrbit.Exclusive ? OpenTableGrbit.DenyWrite : OpenTableGrbit.None, out Table); InitColumns(); }
public XbimShapeGeometryCursor(XbimModel model, string database, OpenDatabaseGrbit mode) : base(model, database, mode) { Api.JetOpenTable(this.sesid, this.dbId, GeometryTableName, null, 0, mode == OpenDatabaseGrbit.ReadOnly ? OpenTableGrbit.ReadOnly : mode == OpenDatabaseGrbit.Exclusive ? OpenTableGrbit.DenyWrite : OpenTableGrbit.None, out this.table); InitColumns(); }
public EsentShapeInstanceCursor(EsentModel model, string database, OpenDatabaseGrbit mode) : base(model, database, mode) { Api.JetOpenTable(this.Sesid, this.DbId, InstanceTableName, null, 0, mode == OpenDatabaseGrbit.ReadOnly ? OpenTableGrbit.ReadOnly : mode == OpenDatabaseGrbit.Exclusive ? OpenTableGrbit.DenyWrite : OpenTableGrbit.None, out this.Table); InitColumns(); }
/// <summary> /// Opens a database previously attached with <see cref="JetAttachDatabase"/>, /// for use with a database session. This function can be called multiple times /// for the same database. /// </summary> /// <param name="sesid">The session that is opening the database.</param> /// <param name="database">The database to open.</param> /// <param name="dbid">Returns the dbid of the attached database.</param> /// <param name="grbit">Open database options.</param> /// <returns>An ESENT warning code.</returns> public static JET_wrn OpenDatabase( JET_SESID sesid, string database, out JET_DBID dbid, OpenDatabaseGrbit grbit) { return(Api.JetOpenDatabase(sesid, database, null, out dbid, grbit)); }
public void OpenDatabase(string connect, OpenDatabaseGrbit grbit) { if (JetDbid != JET_DBID.Nil) { throw new ApplicationException("Only one database may be opened in an EsentSession"); } JET_DBID dbid; Api.JetOpenDatabase(_session, Database.DatabasePath, connect, out dbid, grbit); JetDbid = dbid; }
/// <summary> /// Constructs a table and opens it /// </summary> /// <param name="instance"></param> /// <param name="database"></param> public EsentEntityCursor(EsentModel model, string database, OpenDatabaseGrbit mode) : base(model, database, mode) { Api.JetOpenTable(Sesid, DbId, ifcEntityTableName, null, 0, mode == OpenDatabaseGrbit.ReadOnly ? OpenTableGrbit.ReadOnly : mode == OpenDatabaseGrbit.Exclusive ? OpenTableGrbit.DenyWrite : OpenTableGrbit.None, out Table); Api.JetOpenTable(Sesid, DbId, ifcEntityIndexTableName, null, 0, mode == OpenDatabaseGrbit.ReadOnly ? OpenTableGrbit.ReadOnly : mode == OpenDatabaseGrbit.Exclusive ? OpenTableGrbit.DenyWrite : OpenTableGrbit.None, out _indexTable); InitColumns(); }
/// <summary> /// Initializes a new instance of the ConnectionBase class. /// </summary> /// <param name="instance">The instance to use for the connection.</param> /// <param name="name">The name of the connection.</param> /// <param name="database">The database to be connected do.</param> /// <param name="grbit">The option to open the database with.</param> protected ConnectionBase(Instance instance, string name, string database, OpenDatabaseGrbit grbit) { this.Tracer = new Tracer("Connection", "Esent Connection", String.Format("Connection {0}", name)); this.Name = name; this.Database = database; this.openedTables = new List<Table>(); this.session = new Session(instance); Api.JetAttachDatabase(this.session, database, AttachDatabaseGrbit.None); Api.JetOpenDatabase(this.session, this.Database, String.Empty, out this.dbid, grbit); this.Tracer.TraceInfo("created. (database '{0}')", this.Database); }
/// <summary> /// Initializes a new instance of the ConnectionBase class. /// </summary> /// <param name="instance">The instance to use for the connection.</param> /// <param name="name">The name of the connection.</param> /// <param name="database">The database to be connected do.</param> /// <param name="grbit">The option to open the database with.</param> protected ConnectionBase(Instance instance, string name, string database, OpenDatabaseGrbit grbit) { this.Tracer = new Tracer("Connection", "Esent Connection", String.Format("Connection {0}", name)); this.Name = name; this.Database = database; this.openedTables = new List <Table>(); this.session = new Session(instance); Api.JetAttachDatabase(this.session, database, AttachDatabaseGrbit.None); Api.JetOpenDatabase(this.session, this.Database, String.Empty, out this.dbid, grbit); this.Tracer.TraceInfo("created. (database '{0}')", this.Database); }
public XbimCursor(XbimModel model, string database, OpenDatabaseGrbit mode) { this.lockObject = new Object(); this.model = model; this.instance = model.Cache.JetInstance; sesid = new Session(instance); Api.JetOpenDatabase(sesid, database, String.Empty, out this.dbId, mode); Api.JetOpenTable(this.sesid, this.dbId, globalsTableName, null, 0, mode == OpenDatabaseGrbit.ReadOnly ? OpenTableGrbit.ReadOnly : mode == OpenDatabaseGrbit.Exclusive ? OpenTableGrbit.DenyWrite : OpenTableGrbit.None, out this.globalsTable); this.entityCountColumn = Api.GetTableColumnid(this.sesid, this.globalsTable, entityCountColumnName); this.geometryCountColumn = Api.GetTableColumnid(this.sesid, this.globalsTable, geometryCountColumnName); this.flushColumn = Api.GetTableColumnid(this.sesid, this.globalsTable, flushColumnName); this.ifcHeaderColumn = Api.GetTableColumnid(this.sesid, this.globalsTable, ifcHeaderColumnName); ReadOnly = (mode == OpenDatabaseGrbit.ReadOnly); }
protected EsentCursor(EsentModel model, string database, OpenDatabaseGrbit mode) { LockObject = new Object(); Model = model; Instance = model.Cache.JetInstance; Sesid = new Session(Instance); Api.JetOpenDatabase(Sesid, database, String.Empty, out DbId, mode); Api.JetOpenTable(Sesid, DbId, GlobalsTableName, null, 0, mode == OpenDatabaseGrbit.ReadOnly ? OpenTableGrbit.ReadOnly : mode == OpenDatabaseGrbit.Exclusive ? OpenTableGrbit.DenyWrite : OpenTableGrbit.None, out GlobalsTable); EntityCountColumn = Api.GetTableColumnid(Sesid, GlobalsTable, EntityCountColumnName); GeometryCountColumn = Api.GetTableColumnid(Sesid, GlobalsTable, GeometryCountColumnName); FlushColumn = Api.GetTableColumnid(Sesid, GlobalsTable, FlushColumnName); IfcHeaderColumn = Api.GetTableColumnid(Sesid, GlobalsTable, ifcHeaderColumnName); ReadOnly = (mode == OpenDatabaseGrbit.ReadOnly); }
/// <summary> /// Opens a database previously attached with <see cref="JetAttachDatabase"/>, /// for use with a database session. This function can be called multiple times /// for the same database. /// </summary> /// <param name="sesid">The session that is opening the database.</param> /// <param name="database">The database to open.</param> /// <param name="dbid">Returns the dbid of the attached database.</param> /// <param name="grbit">Open database options.</param> /// <returns>An ESENT warning code.</returns> public static JET_wrn OpenDatabase( JET_SESID sesid, string database, out JET_DBID dbid, OpenDatabaseGrbit grbit) { return Api.JetOpenDatabase(sesid, database, null, out dbid, grbit); }
/// <summary> /// Opens a database previously attached with <see cref="JetAttachDatabase"/>, /// for use with a database session. This function can be called multiple times /// for the same database. /// </summary> /// <param name="sesid">The session that is opening the database.</param> /// <param name="database">The database to open.</param> /// <param name="connect">Reserved for future use.</param> /// <param name="dbid">Returns the dbid of the attached database.</param> /// <param name="grbit">Open database options.</param> /// <returns>An ESENT warning code.</returns> public static JET_wrn JetOpenDatabase(JET_SESID sesid, string database, string connect, out JET_DBID dbid, OpenDatabaseGrbit grbit) { return Api.Check(Impl.JetOpenDatabase(sesid, database, connect, out dbid, grbit)); }
public static void OpenDatabase(this IEsentSession session, OpenDatabaseGrbit grbit) { session.OpenDatabase(null,grbit); }