internal RemoteDatabase(IRAPISession s, uint objId) { sess = s; handle = new RemoteDevice.DeviceHandle(sess, sess.CeOpenDatabase(ref objId, null, 0, CEDB_AUTOINCREMENT, IntPtr.Zero)); if (handle.IsInvalid) { throw new RapiException(sess.CeGetLastError()); } ObjectId = objId; CurrentRecordId = 0; }
/// <summary> /// Initializes a new instance of the <see cref="RemoteDatabase"/> class and opens an existing database in the object store on a remote Microsoft® Windows® CE–based device. /// </summary> /// <param name="device">The device.</param> /// <param name="objId">The object identifier of the database to be opened.</param> /// <param name="autoIncr">If set to <c>true</c> current seek position is automatically incremented with each call to the ReadRecordProps method.</param> /// <param name="sortId">Property identifier of the primary key for the sort order in which the database is to be traversed. Subsequent calls to Seek assume this sort order. This parameter can be zero if the sort order is not important.</param> public RemoteDatabase(RemoteDevice device, uint objId, bool autoIncr, uint sortId) { sess = device.ISession; handle = new RemoteDevice.DeviceHandle(sess, sess.CeOpenDatabase(ref objId, null, sortId, autoIncr ? CEDB_AUTOINCREMENT : 0, IntPtr.Zero)); if (handle.IsInvalid) { device.ThrowRAPIException(); } ObjectId = objId; CurrentRecordId = 0; }