I've noticed that row objects tend not to like to travel outside the scope of a search loop, even if the unique option is set. For example, this code works OK:
Whereas this can crash with a protected memory violation:Code:foreach (Row r in tab.Search("*", "", RowInstance.Unique)) { this.Manipulate(r); tab.Update(r); break; }
This seems to go against common programming sense, but obviously code design can accommodate this.Code:Row row = null; foreach (Row r in tab.Search("*", "", RowInstance.Unique)) { row = r; break; } if (row != null) { this.Manipulate(row); tab.Update(row); }

Reply With Quote


Bookmarks