﻿<?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?)  » Problems calling FillByPrimaryKey method of a BO</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 04:00:48 GMT</lastBuildDate><ttl>20</ttl><item><title>Problems calling FillByPrimaryKey method of a BO</title><link>http://forum.strataframe.net/FindPost27775.aspx</link><description>Hi All.&lt;/P&gt;&lt;P&gt;I am baffled. I must be doing something stupid.&lt;/P&gt;&lt;P&gt;This line of code:&lt;/P&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;&lt;P&gt;boSchedule_hdr&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;.FillByPrimaryKey(tiSchedHdr_id);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;gives me this error:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;Error&amp;nbsp;1&amp;nbsp;An object reference is required for the non-static field, method, or property 'MicroFour.StrataFrame.Business.BusinessLayer.FillByPrimaryKey(int)'&amp;nbsp;F:\TGIF\Libs\HandicapCalculator.cs&amp;nbsp;14&amp;nbsp;13&amp;nbsp;TGIF&lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;This line of code:&lt;/FONT&gt;&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;boCalcPar.GetLast3Scores(&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Convert&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.ToDateTime(&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;boSchedule_hdr&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.play_dte.ToString()), tiPerson_id);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;gives me this error:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Error&amp;nbsp;2&amp;nbsp;An object reference is required for the non-static field, method, or property 'TGIF.BusinessObject.boSchedule_hdr.play_dte.get'&amp;nbsp;F:\TGIF\Libs\HandicapCalculator.cs&amp;nbsp;36&amp;nbsp;57&amp;nbsp;TGIF&lt;BR&gt;&lt;/P&gt;&lt;P&gt;but this line of code works just fine:&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;boPerson.FillByPrimaryKey(tiPerson_id);&lt;/P&gt;&lt;P&gt;Also, the lines of code that are causing errors now worked just fine in the form where they were originally. I am trying to abstract the form method into a class of its own because I now need this functionality from multiple places. &lt;/P&gt;&lt;P&gt;Any ideas are greatly appreciated.&lt;/P&gt;&lt;P&gt;TIA.&lt;/P&gt;&lt;P&gt;Marcia&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Thu, 29 Jul 2010 09:59:25 GMT</pubDate><dc:creator>Marcia G Akins</dc:creator></item><item><title>RE: Problems calling FillByPrimaryKey method of a BO</title><link>http://forum.strataframe.net/FindPost27779.aspx</link><description>Glad you got it figured out....confessional debugging at its best!</description><pubDate>Thu, 29 Jul 2010 09:59:25 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Problems calling FillByPrimaryKey method of a BO</title><link>http://forum.strataframe.net/FindPost27776.aspx</link><description>That was it. I was doing something stupid :)&lt;/P&gt;&lt;P&gt;I was instantiating the BO like this:&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;boSchedule_hdr&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; boSchedule_hdr = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;boSchedule_hdr&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;();&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;And then calling its methods like this:&lt;/FONT&gt;&lt;/P&gt;&lt;FONT size=2&gt;&lt;FONT size=2&gt;&lt;P&gt;boSchedule_Hdr.FillByPrimaryKey(tiSchedHdr_id);&lt;/P&gt;&lt;P&gt;The error message did not give a true indication of what the actual problem was.&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;</description><pubDate>Thu, 29 Jul 2010 08:54:56 GMT</pubDate><dc:creator>Marcia G Akins</dc:creator></item></channel></rss>