StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



INSERT failsExpand / Collapse
Author
Message
Posted 08/28/2006 10:01:01 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: Forum Members
Last Login: 11/02/2006 10:04:26 AM
Posts: 18, Visits: 22
Hello,

The SELECT and the EDIT functions work well in my App, however INSERT fails with the following message:

BusinessLayerException
 An error occurred while saving an the data to the server.
DataLayerSavingException
 Cannot insert the value NULL into column 'id_saison', table 'EKZ7.dbo.Saison'; column does not allow nulls. INSERT fails.
The statement has been terminated.
SqlException
 Cannot insert the value NULL into column 'id_saison', table 'EKZ7.dbo.Saison'; column does not allow nulls. INSERT fails.
The statement has been terminated.

Source     : MicroFour StrataFrame Business

Stack Trace:
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)

   [...]

Well, it is true, I do not allow nulls in the column id_saison because this is my primary key column.

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.

Thanks for your help, ...gerhard...

Post #2489
Posted 08/28/2006 11:53:28 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 10:49:29 PM
Posts: 4,379, Visits: 4,412
Gerhard,

This is due to your database design.  You have the AllowNullValuesOnNewRow property set to Fasle on a business object, it will automatically initialize the row for you.  But bottom line is that this is a SQL Server error and it means what it says.  If you do not provide a value and the field is NULL, it will throw an exception.  First, try setting the AllowNullValuesOnNewRow property to False.  Also, have you added an auto-incrementing integer primary key to your table strucutres as we had talked about before?  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.  Thanks

Post #2492
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 7:20pm

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.109. 10 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.