﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Save method changes currentrow?</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Wed, 10 Jun 2026 20:36:20 GMT</lastBuildDate><ttl>20</ttl><item><title>Save method changes currentrow?</title><link>http://forum.strataframe.net/FindPost4577.aspx</link><description>I noticed that when I call Save() from code, the current row is changed.  I was saving changes to two rows. I used the SeekByPrimaryKey() to navigate to the rows to change, change the data via properties, then saved using Save. After I was done, the first row in the BO was the current row. This row wasn't involved in the changes.  There is a Sort set on the BO.  What's up? Is this normal? Why? Inquiring minds want to know!  ;)&lt;br&gt;
&lt;br&gt;</description><pubDate>Fri, 17 Nov 2006 12:47:02 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Save method changes currentrow?</title><link>http://forum.strataframe.net/FindPost4599.aspx</link><description>Great!</description><pubDate>Fri, 17 Nov 2006 12:47:02 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Save method changes currentrow?</title><link>http://forum.strataframe.net/FindPost4597.aspx</link><description>Disposing of the BO handles both... in the Dispose() method of the BO, we handle the call to CurrentDataTable.Dispose().</description><pubDate>Fri, 17 Nov 2006 12:40:47 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Save method changes currentrow?</title><link>http://forum.strataframe.net/FindPost4594.aspx</link><description>If I have a reference to a BO in code and then a reference to that BO's datatable, do I need to dispose of the datatable explicitly? Or does disposing of the BO handle both?</description><pubDate>Fri, 17 Nov 2006 10:25:06 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Save method changes currentrow?</title><link>http://forum.strataframe.net/FindPost4593.aspx</link><description>Ah, OK.  I'm going to check my code now....time to take out the garbage  :D</description><pubDate>Fri, 17 Nov 2006 10:15:17 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Save method changes currentrow?</title><link>http://forum.strataframe.net/FindPost4591.aspx</link><description>You don't :)&lt;/P&gt;&lt;P&gt;Unlike the AddHandler/RemoveHandler, the WithEvents/Handles combo does not have a way remove the handler.&amp;nbsp; However, they get cleaned up when the class handling the event is disposed and garbage collected.</description><pubDate>Fri, 17 Nov 2006 10:07:46 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Save method changes currentrow?</title><link>http://forum.strataframe.net/FindPost4590.aspx</link><description>So, if I'm just using the WithEvents in the declare and then Handles for the specific event, how do I clean that up?</description><pubDate>Fri, 17 Nov 2006 10:05:23 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Save method changes currentrow?</title><link>http://forum.strataframe.net/FindPost4586.aspx</link><description>Obviously I do not know what your code is doing, but the number one killer of many .NET developers is not cleaning up after the code and expecting the garbage collector to do the work.&amp;nbsp; The other thing, that goes hand in hand here, are event handlers.&amp;nbsp; If you ever gain a handler reference to any object, not just a BO, it will stay there until you explicitly remove the handler.&amp;nbsp; The issue you are describing sounds more like an event handler issue to me...but you will definitely want to Dispose your manually created objects when you are through with them...whether it be a BO or some other type of object.</description><pubDate>Fri, 17 Nov 2006 09:32:00 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Save method changes currentrow?</title><link>http://forum.strataframe.net/FindPost4584.aspx</link><description>hmmmm...it sure was last night.  Could this sort of thing be caused if I'm not cleaning up after myself (not disposing of BOs created in code for example)?  I just read that bit yesterday and I'm probably not doing a good job of that yet.  :blush:</description><pubDate>Fri, 17 Nov 2006 09:27:49 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Save method changes currentrow?</title><link>http://forum.strataframe.net/FindPost4582.aspx</link><description>We do not sort the BO anywhere in the code explicitly.&amp;nbsp; We will remember this setting in certain cases.&amp;nbsp; As for the row, it should end back up on the same row.&amp;nbsp; The only way it would not is if you have AutoNavigateToFirstBrokenRow set to True, which by default it is, then that row has broken rules that need to be corrected.&amp;nbsp; We do move through the rows when checking broken rules, but we &lt;STRONG&gt;ALWAYS&lt;/STRONG&gt; end back up on the initial row unless you have forcefully moved the record position or you have broken rules and the AutoNavigateToFirstBrokenRow is set to True and another row had a broken rule.</description><pubDate>Fri, 17 Nov 2006 09:18:15 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>