I don't know how many hours, days, or weeks I have wasted over the past year trying to recuperate from form designer crashes. I recognize that my database schema is evolving, but the amount of time I spend reconstructing data connections is rediculous. For example, with one SQLce 3.5 database and two tables, something is causing the form designer to crash (not display the form) and issue the following error message:
Warning: DataMember property 'RentComps' cannot be found on the DataSource (followed by a pointer to the database file)
In fact the database is there, and the schema is up-to-date. The line number given in the error message points to the following VB statement in the form designer:
CType(Me.REdataDataSet, System.ComponentModel.ISupportInitialize).EndInit()
In the past, I have eveolved the following sequence to accomodate schema changes and keep the designer happy:
1 - disconnect databindings of form controls on CRUD forms
2 - make changes to table schema in SQLce database (schema master)
3 - run sqlmetal against the SQLce database
4 - copy generated .dbml file to VS project
5 - copy schema master database to VS project (for use as design-time DB connection)
6 - in VS dataset designer, delete and regenerate the affected tables and table adapters (to pick up the schema changes)
7 - reconnect databindings of form controls on CRUD forms
8 - rebuild the project
I have also heard that designer files should not be viewed while rebuilding the project. I have also noticed that some datagridviews have had column names suggesting that they were generated from old data schemas.
What is the best way to avoid this type of designer corruption and maintain synchronization between the data sources and thedesigner?
Thanks,
-BGood