﻿<?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 » Issues  » "Field" does not belong to table error.</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 26 May 2026 16:07:38 GMT</lastBuildDate><ttl>20</ttl><item><title>"Field" does not belong to table error.</title><link>http://forum.strataframe.net/FindPost17117.aspx</link><description>To handle this error, I've generated FieldAccessing Event for all fields. &lt;/P&gt;&lt;P&gt;But the code that event is fired&amp;nbsp;comes after the code that column is accessed. So, I couldn't handle this condition. I'm trying to catch property access, check column if exist. If column does not exist then column will be added&amp;nbsp;to the table.&lt;/P&gt;&lt;P&gt;Is there alternative way to accomplish tis type of requirement ?&amp;nbsp;&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;FONT size=2&gt; loValue;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;CompaniesFieldAccessingEventArgs&lt;/FONT&gt;&lt;FONT size=2&gt; e;&lt;/P&gt;&lt;P&gt;System.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt; loReturn;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#dd1111&gt;loValue = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#dd1111&gt;&lt;FONT size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.CurrentRow[&lt;/FONT&gt;&lt;FONT size=2&gt;"name"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#dd1111&gt;];&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;if&lt;/FONT&gt;&lt;FONT size=2&gt; (loValue == &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;DBNull&lt;/FONT&gt;&lt;FONT size=2&gt;.Value)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;loReturn = &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt;.Empty;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;else&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;loReturn = (System.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt;)loValue;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;e = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;CompaniesFieldAccessingEventArgs&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;CompaniesFieldNames&lt;/FONT&gt;&lt;FONT size=2&gt;.name, loReturn);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#dd1111&gt;&lt;FONT size=2&gt;this&lt;/FONT&gt;&lt;FONT size=2&gt;.OnFieldPropertyAccessing(&lt;/FONT&gt;&lt;FONT size=2&gt;this&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#dd1111&gt;, e);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;return&lt;/FONT&gt;&lt;FONT size=2&gt; (System.&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt;)e.ValueToReturn;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Mon, 07 Jul 2008 08:18:04 GMT</pubDate><dc:creator>Ertan Deniz</dc:creator></item><item><title>RE: "Field" does not belong to table error.</title><link>http://forum.strataframe.net/FindPost17662.aspx</link><description>[quote]Remark : Devexpress Grid tries to reach each property even if is not selected. An exception occurs. So, every column and plus custom fields have to be included in the query.[/quote]&lt;/P&gt;&lt;P&gt;Ahhh....yeah, that makes sense.&amp;nbsp; Glad you found a solution.</description><pubDate>Mon, 07 Jul 2008 08:18:04 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: "Field" does not belong to table error.</title><link>http://forum.strataframe.net/FindPost17658.aspx</link><description>I've found a hard way which seems to be infeasible. StrataFrame may solve this internally.&lt;/P&gt;&lt;P&gt;My Solution : In CurrentDataTableReFilled event, I 'm&amp;nbsp;trying to define all the fields that are not included in the query.&lt;/P&gt;&lt;P&gt;Remark : Devexpress Grid tries to reach each property even if is not selected. An exception occurs. So, every column and plus custom fields have to be included in the query.&amp;nbsp;</description><pubDate>Mon, 07 Jul 2008 03:50:18 GMT</pubDate><dc:creator>Ertan Deniz</dc:creator></item><item><title>RE: "Field" does not belong to table error.</title><link>http://forum.strataframe.net/FindPost17466.aspx</link><description>Any Comment ?</description><pubDate>Mon, 30 Jun 2008 01:13:16 GMT</pubDate><dc:creator>Ertan Deniz</dc:creator></item><item><title>RE: "Field" does not belong to table error.</title><link>http://forum.strataframe.net/FindPost17203.aspx</link><description>As you said, there may be many points to consider. Each of them have to be handled with specific code.&lt;/P&gt;&lt;P&gt;In my case, I want to handle "Object.Property1" case. When I'm trying to use property1, I need to ensure that&amp;nbsp;the field&amp;nbsp;is in the datatable. I couldn't write control logic for each property. Is there a general way that&amp;nbsp;is known? This is my need.</description><pubDate>Fri, 20 Jun 2008 01:02:17 GMT</pubDate><dc:creator>Ertan Deniz</dc:creator></item><item><title>RE: "Field" does not belong to table error.</title><link>http://forum.strataframe.net/FindPost17169.aspx</link><description>This depends entirely on your code.&amp;nbsp; When I have this issue, and depending on how I may use it, I may include this in the AfterAddNew or the CurrentDataTableRefilled event...it depends entirely on what you are trying to accomplish...I am not sure how to give you a straight answer on this without digging into your code.</description><pubDate>Thu, 19 Jun 2008 10:05:29 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: "Field" does not belong to table error.</title><link>http://forum.strataframe.net/FindPost17162.aspx</link><description>Any comment ?</description><pubDate>Thu, 19 Jun 2008 08:06:21 GMT</pubDate><dc:creator>Ertan Deniz</dc:creator></item><item><title>RE: "Field" does not belong to table error.</title><link>http://forum.strataframe.net/FindPost17136.aspx</link><description>I know your method. I couldn't get answer how to use this method. See post below.&lt;/P&gt;&lt;P&gt;&lt;A href="http://forum.strataframe.net/Topic15238-6-1.aspx"&gt;http://forum.strataframe.net/Topic15238-6-1.aspx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;if you give a new position for FieldAccessing Event. This may solve the situation.&lt;/P&gt;&lt;P&gt;But I need quick way to progress. Where is the place to call the method. (EnsureColumnExist) There must be a central point.</description><pubDate>Wed, 18 Jun 2008 01:17:33 GMT</pubDate><dc:creator>Ertan Deniz</dc:creator></item><item><title>RE: "Field" does not belong to table error.</title><link>http://forum.strataframe.net/FindPost17134.aspx</link><description>In our medical app I created a shared method in our of our base classes that I pass over a DataTable, expected field, and field type.&amp;nbsp; It then ensures that the column exists within the DataTable so that if a query is not performed, yet I have code expecting that field to have been returned from the query, I do not get an error.&amp;nbsp; This way I can use it across BOs, etc.</description><pubDate>Tue, 17 Jun 2008 20:10:56 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>