﻿<?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?)  » Problem adding first record to table</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Wed, 23 Sep 2026 20:23:46 GMT</lastBuildDate><ttl>20</ttl><item><title>Problem adding first record to table</title><link>http://forum.strataframe.net/FindPost21167.aspx</link><description>Hi there, my first post.&lt;/P&gt;&lt;P&gt;I have this problem with all my window forms. When I try to add a record to table with no records I get &lt;/P&gt;&lt;P&gt;"InvalidCastException was unhandled by user code". &lt;/P&gt;&lt;P&gt;The field is a text field in which null is not allowed. There is a default value set. &lt;/P&gt;&lt;P&gt;If there are already 1 or more records in the table no error occurs. &lt;/P&gt;&lt;P&gt;I can see that the Add method of the BO is calling the Get method for the text field. Why does it do this on an Add action?&lt;/P&gt;&lt;P&gt;Thanks in advance for any help.</description><pubDate>Fri, 12 Dec 2008 14:29:12 GMT</pubDate><dc:creator>Rylster</dc:creator></item><item><title>RE: Problem adding first record to table</title><link>http://forum.strataframe.net/FindPost21168.aspx</link><description>Well, you have a few details that are left out so let's fill in a few blanks.&amp;nbsp; A cast exception is going to occur anytime that you try to stuff a data type of one type into another without any type of conversion (i.e. attempt to place a string into an integer).&amp;nbsp; This can come from literally an unlimited number of things.&amp;nbsp; So if you could post the stack trace, that would be great.&amp;nbsp; Also, from just hearing what you are dealing with, have you mapped the BO through the BO Mapper and rebuilt the partial classes for your BOs?</description><pubDate>Fri, 12 Dec 2008 14:29:12 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>