﻿<?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?)  » INSERT fails</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 05 May 2026 20:42:14 GMT</lastBuildDate><ttl>20</ttl><item><title>INSERT fails</title><link>http://forum.strataframe.net/FindPost2489.aspx</link><description>Hello,&lt;/P&gt;&lt;P&gt;The SELECT and the EDIT functions work well in my App, however INSERT fails with the following message:&lt;/P&gt;&lt;P&gt;BusinessLayerException&lt;BR&gt;&amp;nbsp;An error occurred while saving an the data to the server.&lt;BR&gt;DataLayerSavingException&lt;BR&gt;&amp;nbsp;Cannot insert the value NULL into column 'id_saison', table 'EKZ7.dbo.Saison'; column does not allow nulls. INSERT fails.&lt;BR&gt;The statement has been terminated.&lt;BR&gt;SqlException&lt;BR&gt;&amp;nbsp;Cannot insert the value NULL into column 'id_saison', table 'EKZ7.dbo.Saison'; column does not allow nulls. INSERT fails.&lt;BR&gt;The statement has been terminated.&lt;/P&gt;&lt;P&gt;Source&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : MicroFour StrataFrame Business&lt;/P&gt;&lt;P&gt;Stack Trace: &lt;BR&gt;&amp;nbsp;&amp;nbsp; at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; [...]&lt;/P&gt;&lt;P&gt;Well, it is true, I do not allow nulls in the column id_saison because this is my primary key column.&lt;/P&gt;&lt;P&gt;This happens with all tables I have in my database and that's why I guess that I just haven't set up the database properly.&lt;/P&gt;&lt;P&gt;Thanks for your help, ...gerhard...</description><pubDate>Mon, 28 Aug 2006 11:53:28 GMT</pubDate><dc:creator>Gerhard Jaros</dc:creator></item><item><title>RE: INSERT fails</title><link>http://forum.strataframe.net/FindPost2492.aspx</link><description>Gerhard,&lt;/P&gt;&lt;P&gt;This is due to your database design.&amp;nbsp; You have the AllowNullValuesOnNewRow property set to Fasle on a business object, it will automatically initialize the row for you.&amp;nbsp; But bottom line is that this is a SQL Server error and it means what it says.&amp;nbsp; If you do not provide a value and the field is NULL, it will throw an exception.&amp;nbsp; First, try setting the AllowNullValuesOnNewRow property to False.&amp;nbsp; Also, have you added an auto-incrementing integer primary key to your table strucutres as we had talked about before?&amp;nbsp; I know this is not necessary in order to work with StrataFrame and BOs, but in your case I think this would make things much easier for you.&amp;nbsp; Thanks</description><pubDate>Mon, 28 Aug 2006 11:53:28 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>