An Entity Data Model is used to generate the script to create a SQL CE database. It creates all of the 10+ tables and their primary keys without any problem. A lot of foreign key creations generate errors like the following:
SQL Execution Error.
Executed SQL statement ALTER TABLE [tblA] ADD CONSTRAINT [FK_tblA_tblB] FOREIGN KEY([A], [B], [C]) REFERENCES [tblB]([A], [BBB], [C])
Error Source: SQL Server Compact ADO.NET Data Provider
Error Message: The referenced table must have a primary or candidate key. [ FK Name = FK_tblA_tblB ]
The primary keys are there and correct. Could anyone offer some tips on how to figure out what is wrong?hz
View Complete Post