﻿<?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?)  » Parent - Child relationship BO using DevExpress Grid</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sun, 05 Apr 2026 09:29:24 GMT</lastBuildDate><ttl>20</ttl><item><title>Parent - Child relationship BO using DevExpress Grid</title><link>http://forum.strataframe.net/FindPost6515.aspx</link><description>I have a Maintenance form in which I have dropped a DevExpress grid populated by a BBS bound to a Parent BO. I have also placed five other grids each in their own tab and each being populated by separate BBS's and Child BO's. I have set up the relationships of the child BO's through the designer and set the parent BO property&amp;nbsp;of each child. It works fine when navigating records and the child records display as expected. I can pick a Parent record, and edit the child records, it saves and edits fine. The problem is when I try to add a Parent record and save I get an exception saying that I can't insert a null value into a field. I was under the impression that when a Parent/Child relationship is setup, SF will manage the foreign keys. &lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forum.strataframe.net/Uploads/Images/b2b803eb-38f7-4a60-a297-deb3.jpg"&gt;&lt;/P&gt;&lt;P&gt;I need to lock down the parent grid but leave the child grids editable. When the user clicks edit, it unlocks the parent grid and locks the child grid until a save is made.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Here is one of the exceptions I get:&lt;/P&gt;&lt;P&gt;Exception (BusinessLayerException): Source="MicroFour StrataFrame Business"; Target=null; Tag=null; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Message = "An error occurred while saving an the data to the server."&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; InnerException (DataLayerSavingException): Source="MicroFour StrataFrame Business"; Target=null; Tag=null; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Message = &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Cannot insert the value NULL into column 'FramerID', table 'StarkMasterDB.dbo.Framers'; column does not allow nulls. INSERT fails.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The statement has been terminated."&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StackTrace = &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.Data.DataLayer.SaveByForm(DataTable TableToSave, Boolean Transactional, String TransactionKey)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.Business.BusinessLayer.SaveByForm(Boolean Transactional, String TransactionKey)"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InnerException (SqlException): Message=(-&amp;gt;Message); Source=".Net SqlClient Data Provider"; Target=null; Tag=null; Class=16; LineNumber=1; Number=515; Procedure=""; Server="1lprmoore"; State=2; ErrorCode=-2146232060; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StackTrace = &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&amp;nbsp;&amp;nbsp; at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Data.SqlClient.SqlDataReader.getMetaData()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior ... (truncated) ...Command.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Data.Common.DbCommand.ExecuteReader()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.Data.DbDataSourceItem.InternalExecuteReader(DbCommand Command, Boolean IsTransactional, String TransactionKey)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.Data.SqlDataSourceItem.UpdateRow(QueryInformation QueryInfo, DataRow RowToUpdate, ConcurrencyExceptionHandler ConcurrencyHandler, AddRowErrorHandler RowErrorHandler, Boolean RecreateCommand)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.Data.DbDataSourceItem.UpdateRow(QueryInformation QueryInfo, DataRow RowToUpdate, ConcurrencyExceptionHandler ConcurrencyHandler, AddRowErrorHandler RowErrorHandler)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.Data.DataLayer.UpdateDataTableThread(Object ThreadParams)"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Errors (SqlErrorCollection): Count=2; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #0 = {System.Data.SqlClient.SqlError: Cannot insert the value NULL into column 'FramerID', table 'StarkMasterDB.dbo.Framers'; column does not allow nulls. INSERT fails.}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #1 = {System.Data.SqlClient.SqlError: The statement has been terminated.}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SaveErrors (DataLayerSaveErrorCollection): Count=1; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #0 = MicroFour.StrataFrame.Data.DataLayerSaveError&lt;BR&gt;&amp;nbsp; &lt;BR&gt;&amp;nbsp; Environment:&amp;nbsp; ThreadIdentity="" DateTime=["2007-02-02 10:22:55.081"] ThreadName=null WindowsIdentity="STRUSS\RMoore" ThreadId="11" DemoVersion="True" DomainName=["Project Tracker.vshost.exe"] OSVersion=["Microsoft Windows NT 5.1.2600 Service Pack 2"] MachineName="1LPRMOORE" UserName="RMoore"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Any insight as to what happens to the Parent and Child BO's when the edit, save, delete, and new buttons are clicked on the maintenace toolstrip would be helpful.</description><pubDate>Fri, 02 Feb 2007 17:28:43 GMT</pubDate><dc:creator>Randy Moore</dc:creator></item><item><title>RE: Parent - Child relationship BO using DevExpress Grid</title><link>http://forum.strataframe.net/FindPost6551.aspx</link><description>Yes.&amp;nbsp; And the reason you got the error is because the Enforce FK Contraints is set to True without cascading the delete.&amp;nbsp;</description><pubDate>Fri, 02 Feb 2007 17:28:43 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Parent - Child relationship BO using DevExpress Grid</title><link>http://forum.strataframe.net/FindPost6548.aspx</link><description>I figured it wouldn't have anything to do with SF. Here's my relationships:&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forum.strataframe.net/Uploads/Images/0dd2c41e-be7b-4aa0-9c3c-a759.Jpg"&gt;&lt;/P&gt;&lt;P&gt;Is that what you meant by cascade?</description><pubDate>Fri, 02 Feb 2007 15:55:02 GMT</pubDate><dc:creator>Randy Moore</dc:creator></item><item><title>RE: Parent - Child relationship BO using DevExpress Grid</title><link>http://forum.strataframe.net/FindPost6531.aspx</link><description>THis has nothing to do with StrataFrame, but rather you FK definitions on your SQL Server.&amp;nbsp; The message it telling you that you have a FK relationship between the parent and child records and that child records exist.&amp;nbsp; To resolve this, update your FK relationship on the SQL Server side to cascade the deletions to the child records.&amp;nbsp; This will eliminate the error.</description><pubDate>Fri, 02 Feb 2007 13:19:59 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Parent - Child relationship BO using DevExpress Grid</title><link>http://forum.strataframe.net/FindPost6526.aspx</link><description>Here's the&amp;nbsp;message that I get when I try to delete a record from the Parent BO:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; The DELETE statement conflicted with the REFERENCE constraint "FKRoofsJobs". The conflict occurred in database "StarkMasterDB", table "dbo.Roofs", column 'JobID'.&lt;BR&gt;&amp;nbsp; The statement has been terminated.&lt;BR&gt;&amp;nbsp; &lt;BR&gt;&amp;nbsp; Exception (SqlException): Source=".Net SqlClient Data Provider"; Target=null; Tag=null; Class=16; LineNumber=1; Number=547; Procedure=""; Server="1lprmoore"; State=0; ErrorCode=-2146232060; &lt;/P&gt;&lt;P&gt;The Jobs&amp;nbsp;table&amp;nbsp;is the parent, with&amp;nbsp;primary key JobID. Roofs is the child with FK JobID. There may be a problem in the DB since I have been adding to the jobs table before all the relationships were in place. I was going to recreate the DB and enter data through the app? What do you think.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</description><pubDate>Fri, 02 Feb 2007 11:42:07 GMT</pubDate><dc:creator>Randy Moore</dc:creator></item><item><title>RE: Parent - Child relationship BO using DevExpress Grid</title><link>http://forum.strataframe.net/FindPost6525.aspx</link><description>Well, you went straight to the next step, which is good :)&amp;nbsp; What is the error you are getting on the delete?</description><pubDate>Fri, 02 Feb 2007 11:10:06 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Parent - Child relationship BO using DevExpress Grid</title><link>http://forum.strataframe.net/FindPost6524.aspx</link><description>Trent,&lt;/P&gt;&lt;P&gt;Yes, I&amp;nbsp;have already looked at that sample application. I double-checked all the settings of my Child BO's, all relationships and ParentBusinessObject properties are configured properly. I changed the Form Include properties to be:&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forum.strataframe.net/Uploads/Images/a45dde49-6e94-4037-896e-7b28.Jpg"&gt;&lt;/P&gt;&lt;P&gt;Seems to be working now except for deleting a parent record.</description><pubDate>Fri, 02 Feb 2007 10:36:59 GMT</pubDate><dc:creator>Randy Moore</dc:creator></item><item><title>RE: Parent - Child relationship BO using DevExpress Grid</title><link>http://forum.strataframe.net/FindPost6519.aspx</link><description>Well, let's take the grid out of the forumula because this will only complicate the concept.&amp;nbsp; The grid is not any part of the forumla in this case.&amp;nbsp; You are correct the SF will automatically handle the FK relationship, so I am willing to bet that you are having one of two issues.&lt;/P&gt;&lt;P&gt;One, the relationship is not defined (which I think you have already done this).&amp;nbsp; So two, did you set the ParentBusinessObject property of the child BO?&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forum.strataframe.net/Uploads/Images/f1c10c65-978a-426e-86dd-58fa.jpg"&gt;&lt;/P&gt;&lt;P&gt;The above picture is taken from the property sheet of the CRM Sample Application that ships with StrataFrame.&amp;nbsp; This is the CustomerCreditCards BO on the CustomerMaintenance form.&amp;nbsp; I recommend looking CRM Sample Application so that you can see how these BOs need to be configured in order for the FK to be automatically managed.</description><pubDate>Fri, 02 Feb 2007 10:01:10 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>