I have a C# windows form containing a details view and a datagrid. Adding a record was working fine, but suddenly stopped working. When working properly, clicking the add button would insert -1, etc. into the ID field which is set to auto number. Now the number fails to appear and the data won't save back to the database. I can input a number and the record will save. I use MySql, and the record insert and auto-mumbering works fine when using Workbench. The form is built with VS 2010 professional, so there is lots of code generated. Where do I look for corrupt code? I have a similar windows form connecting to a different database and it continues to work properly.
Thank you for you help. I really don't want to rebuild the form from scratch.
What I have tried:
I looked for anything obvious with no success. And I rebuilt the form with no luck. Changed from .net 4 to 3.5 with no luck.