﻿<?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?)  » FillByPrimaryKey problem</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Thu, 28 May 2026 12:07:44 GMT</lastBuildDate><ttl>20</ttl><item><title>FillByPrimaryKey problem</title><link>http://forum.strataframe.net/FindPost6430.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;My BO is well configured and the DB ids fine. I want to add a custom fill method :&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;public&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; FillAllByID( int user)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;{&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FillByPrimaryKey(user);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;&lt;P&gt;I'm having a SqlException saying " Invalid object name .." with the name of the table. The table name is good. Since the framework take care of the connection,&amp;nbsp;am&amp;nbsp;I missing something?</description><pubDate>Tue, 30 Jan 2007 20:41:26 GMT</pubDate><dc:creator>Joseph-Carl Theodat</dc:creator></item><item><title>RE: FillByPrimaryKey problem</title><link>http://forum.strataframe.net/FindPost6456.aspx</link><description>Glad you got it going :)</description><pubDate>Tue, 30 Jan 2007 20:41:26 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: FillByPrimaryKey problem</title><link>http://forum.strataframe.net/FindPost6451.aspx</link><description>I reset my desktop and it work... Anyway.. thanks guys...!!&lt;/P&gt;&lt;P&gt;Have a good one</description><pubDate>Tue, 30 Jan 2007 17:35:32 GMT</pubDate><dc:creator>Joseph-Carl Theodat</dc:creator></item><item><title>RE: FillByPrimaryKey problem</title><link>http://forum.strataframe.net/FindPost6450.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;I tried before a SQL&amp;nbsp; Fill data table and the same result. I know how to make a basic sql statement and there is somehow there is something wrong ...&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I did:&lt;/P&gt;&lt;P&gt;1- Add BO to the project&lt;/P&gt;&lt;P&gt;2- Use the BO mapper to configure my project and the BO , build ok&lt;/P&gt;&lt;P&gt;3- Rebuild the solution&lt;/P&gt;&lt;P&gt;4- Drop the BO object on my form&lt;/P&gt;&lt;P&gt;5- Tried several times the fill FillDataTable with SQL string (same error)&lt;/P&gt;&lt;P&gt;The thing is that my SF DB in&amp;nbsp;on server A and my testing&amp;nbsp;DB in on server B. Both connection&amp;nbsp;were created with the Connection Wizard. But, the SqlException shows server&amp;nbsp;A&amp;nbsp;eventhough the BO was created with server B. I think the&amp;nbsp;answer comes from there&amp;nbsp;... Any idea? &lt;/P&gt;&lt;P&gt;Note:&lt;/P&gt;&lt;P&gt;I add 'this' only the guys who replied for my question :D</description><pubDate>Tue, 30 Jan 2007 17:21:29 GMT</pubDate><dc:creator>Joseph-Carl Theodat</dc:creator></item><item><title>RE: FillByPrimaryKey problem</title><link>http://forum.strataframe.net/FindPost6440.aspx</link><description>Setting the Debug on is always a good idea when you run into something like this.&amp;nbsp; When you are using the intrinsic methods, there are some assumptions made by the framework.&amp;nbsp; In the case of the FillByPrimaryKey, we assume that a primary key has been defined on the BO, for example.&lt;P&gt;As a side note, there is really no need to create a method to call the intrinsic method.&amp;nbsp; You can direcly call the FillByPrimaryKey and pass it the PK value.&amp;nbsp; If you are going to create a custom method, then you might go ahead and call the FillDataTable method and see if you are having the same problems.&lt;/P&gt;&lt;P&gt;I recommend using an SQLDbCommand and parameterized queries, but just for testing purposes, you can just pass a SELECT statement as well.&lt;/P&gt;&lt;P&gt;[codesnippet]this.FillDataTable("SELECT * FROM MyTable WHERE MyPk=123");[/codesnippet]&lt;/P&gt;&lt;P&gt;See if you get the same response in this scenario.&amp;nbsp; But definitely go through the debug mode as well so we can see what the problem is that you are running into.&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; Just as a side note, you do not have to provide the pre-qualifying location in .NET (Me or this).&amp;nbsp; If you call the FillByPrimaryKey method it is the same as&amp;nbsp;calling this.FillByPrimeryKey.</description><pubDate>Tue, 30 Jan 2007 16:38:04 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: FillByPrimaryKey problem</title><link>http://forum.strataframe.net/FindPost6438.aspx</link><description>As you mentioned, this "should" work. Did you turn on SQL debugging to see exactly what SQL was being generated?  That often help you the error.&lt;br&gt;
&lt;br&gt;
In AppMain.cs (or whatever is the main app file in C#), at the bottom of the SetDataSources() method, add this:&lt;br&gt;
&lt;br&gt;
DataBasics.DataSources("").SetDebugOn("c:\Debug.html",True);&lt;br&gt;
&lt;br&gt;
For more info, see the last post on this page:&lt;br&gt;
&lt;br&gt;
[url]http://forum.strataframe.net/Topic3442-6-2.aspx?Highlight=SetDebugOn[/url]&lt;br&gt;
&lt;br&gt;</description><pubDate>Tue, 30 Jan 2007 16:06:56 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: FillByPrimaryKey problem</title><link>http://forum.strataframe.net/FindPost6435.aspx</link><description>I tried already ...(calling from the code,&amp;nbsp;&amp;nbsp;not BO) ... no success</description><pubDate>Tue, 30 Jan 2007 14:25:20 GMT</pubDate><dc:creator>Joseph-Carl Theodat</dc:creator></item><item><title>RE: FillByPrimaryKey problem</title><link>http://forum.strataframe.net/FindPost6434.aspx</link><description>It's a typo mistake ... in my code it's written this.&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;FillByPrimaryKey(user)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#000000&gt;I am still having the SqlException "invalid object name with TABLENAME"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Tue, 30 Jan 2007 14:20:48 GMT</pubDate><dc:creator>Joseph-Carl Theodat</dc:creator></item><item><title>RE: FillByPrimaryKey problem</title><link>http://forum.strataframe.net/FindPost6433.aspx</link><description>Have you tried to just calling FillByPrimaryKey(user) from code (not in the BO, but from some other code)? Do you get the exception then?</description><pubDate>Tue, 30 Jan 2007 13:59:34 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: FillByPrimaryKey problem</title><link>http://forum.strataframe.net/FindPost6432.aspx</link><description>I think in C## it would be:&lt;br&gt;
&lt;br&gt;
this.FillByPrimaryKey(user);&lt;br&gt;
&lt;br&gt;</description><pubDate>Tue, 30 Jan 2007 13:57:49 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: FillByPrimaryKey problem</title><link>http://forum.strataframe.net/FindPost6431.aspx</link><description>Did you try:&lt;/P&gt;&lt;P&gt;Me.FillByPrimaryKey(User)?&lt;/P&gt;&lt;P&gt;Ben</description><pubDate>Tue, 30 Jan 2007 13:54:58 GMT</pubDate><dc:creator>Ben Kim</dc:creator></item></channel></rss>