Microsoft.Isam.Esent.Interop.Update.Save C# (CSharp) Method

Save() public method

Update the tableid.
Save is the final step in performing an insert or an update. The update is begun by calling creating an Update object and then by calling JetSetColumn or JetSetColumns one or more times to set the record state. Finally, Update is called to complete the update operation. Indexes are updated only by Update or and not during JetSetColumn or JetSetColumns
public Save ( byte bookmark, int bookmarkSize, int &actualBookmarkSize ) : void
bookmark byte Returns the bookmark of the updated record. This can be null.
bookmarkSize int The size of the bookmark buffer.
actualBookmarkSize int Returns the actual size of the bookmark.
return void
        public void Save(byte[] bookmark, int bookmarkSize, out int actualBookmarkSize)
        {
            this.CheckObjectIsNotDisposed();
            if (!this.HasResource)
            {
                throw new InvalidOperationException("Not in an update");
            }

            Api.JetUpdate(this.sesid, this.tableid, bookmark, bookmarkSize, out actualBookmarkSize);
            this.ResourceWasReleased();
        }

Same methods

Update::Save ( ) : void

Usage Example

Beispiel #1
0
		public void Update(Session session, JET_DBID dbid)
		{
			using (var tx = new Transaction(session))
			{
				using (var files = new Table(session, dbid, "files", OpenTableGrbit.None))
				{

					const string indexDef = "+etag\0\0";
					Api.JetCreateIndex(session, files, "by_etag", CreateIndexGrbit.IndexDisallowNull, indexDef, indexDef.Length,
									   100);

					using (var details = new Table(session, dbid, "details", OpenTableGrbit.None))
					{
						Api.JetMove(session, details, JET_Move.First, MoveGrbit.None);
						var columnids = Api.GetColumnDictionary(session, details);

						using (var update = new Update(session, details, JET_prep.Replace))
						{
							Api.SetColumn(session, details, columnids["schema_version"], "2.7", Encoding.Unicode);

							update.Save();
						}
					}
				}
				tx.Commit(CommitTransactionGrbit.None);
			}
		}
All Usage Examples Of Microsoft.Isam.Esent.Interop.Update::Save