Quite a bit has changed in the object model for 9.0.161.0 (release notes). Among other things: The former Manifold.Values class has become Manifold.ValueSet. Previously Values and Schema objects were obtained via a constructor using 'new' syntax: M.Values vals = new M.Values(); M.Schema schema = new M.Schema(); Now ValueSet and Schema are returned by methods on the Application object: M.ValueSet vals = Manifold.Application.CreateValueSet(); M.Schema schema = Manifold.Application.CreateSchema(); (I think these changes are at least partly in connection with point 250 in the release notes, automatic cleanup. A bit less OO and more functional.) Here is a version of Adam's script [1 - write numbers / strings] revised for 9.0.161.0 (with changes noted). // $reference: System.dll // using M = Manifold; using System.Diagnostics; class Script { static Manifold.Context Manifold; static void Main() { M.Database db = Manifold.Application.GetDatabaseRoot(); // create table // M.Schema schema = new M.Schema(); // 9.0.160.x M.Schema schema = Manifold.Application.CreateSchema(); // 9.0.161.0 schema.AddField("num", "int32"); schema.AddField("str", "nvarchar"); string inserted = db.Insert("test", "table", schema); M.Table table = db.Search(inserted); Stopwatch sw = new Stopwatch(); sw.Start(); // add records // M.Values vals = new M.Values(); // 9.0.160.x M.ValueSet vals = Manifold.Application.CreateValueSet(); // 9.0.161.0 vals.AddValue("num"); vals.AddValue("str"); vals = vals.CreateLocked(); // added in 9.0.160.4 int recordCount = 500000; for (int index = 0; index < recordCount; ++index) { vals[0].Data = index; vals[1].Data = (index * 100).ToString(); table.Insert(vals); } sw.Stop(); Manifold.Application.MessageBox(string.Format("Elapsed: {0} ms", sw.ElapsedMilliseconds), "Script"); } }
|