Larry,
>I have created a very simple app using the MM Business Maintenance template. The Parent table is linked to 1 child with multiple rows per parent. Navigating the parent in a grid correctly retrieves all the child records. Add/Editing/etc works fine.
>If I click on the datagridview header of a column (to sort by that column), the navigation works properly but if I edit the parent and try to Save, the system crashes. Even though no changes were done to the child data, the SQL Profiler shows a SQL Update command to a record in the child table trying to replace the parent foreign key with a new value which happens to duplicate an existing primary key and crashes the system. None of the normal rule checking methods are called during the update so how is it happening? Is it a bug in my program, a fault with the framework or some "undocumented" .NET feature?
Can you post the full stack trace of the error?
Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com