Results 1 to 1 of 1

Thread: Constraint Error on Form Load

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2012
    Location
    Minnesota
    Posts
    238

    Constraint Error on Form Load

    I have a winforms program and when I publish the program and load this one form I get a constraint error. I do not get the error when I run the program while debugging. In the Immediate window I will see - A first chance exception of type 'System.Data.ConstraintException' occurred in System.Data.dll error but the form loads just fine. The error seems to be pointing to my Items table which is my child table.

    I have checked the table and I can't find any records that are missing a parent record.
    I have made sure the fill orders are correct on form_load.
    I have checked all my datacolumns in my dataset to make sure they are the right DataType and MaxLength. Thinking maybe I had changed a field type in the database and not changed it in my dataset. But nothing. Everything is correct.

    Has anyone ever seen this? Is there another way to debug this and get more or better information?

    Thanks,
    Stacy
    VS2010 - SQL 2008 R2 RTM

    P.S. I have also checked that fields that are not allowed to be left Null aren't in fact Null. I found none.

    My Dataset isn't the problem is it? I have two parents linked to child tables but not linked to each other - like this...
    Name:  Capture.PNG
Views: 204
Size:  34.3 KB

    This form used to work though, that's what has me stumped. Very frustrating.
    Last edited by StacyOW; Oct 4th, 2013 at 03:08 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width