using System.Data.OleDb; ... OleDbConnection connection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\MyDatabase.mdb"); connection.Open(); OleDbCommand command = new OleDbCommand("SELECT MSysObjects.Id FROM MSysObjects WHERE MSysObjects.Name = 'MyTable'", connection); OleDbDataReader reader = command.ExecuteReader(); reader.Read(); JET_TABLEID tableId = new JET_TABLEID((IntPtr)reader["Id"]);
using Microsoft.Isam.Esent.Interop; ... JET_SESID sessionId; JET_DBID databaseId; Api.JetAttachDatabase(sessionId, "C:\\MyDatabase.mdb", AttachDatabaseGrbit.None); Api.JetOpenDatabase(sessionId, "C:\\MyDatabase.mdb", null, out databaseId, OpenDatabaseGrbit.None); Api.JetBeginTransaction(sessionId); JET_TABLEID tableId; Api.JetOpenTable(sessionId, databaseId, "MyTable", null, 0, OpenTableGrbit.None, out tableId); Api.MakeKey(sessionId, tableId, 123, MakeKeyGrbit.NewKey); Api.TrySeek(sessionId, tableId, SeekGrbit.SeekEQ); Api.JetPrepareUpdate(sessionId, tableId, JET_prep.Replace); Api.SetColumn(sessionId, tableId, Api.GetColumnInfo(sessionId, databaseId, tableId, "MyColumn"), "NewValue"); Api.JetUpdate(sessionId, tableId); Api.JetCommitTransaction(sessionId, CommitTransactionGrbit.None);Package library: Microsoft.Isam.Esent.Interop