How do you create a foreign key relationship in a SQL Server CE (Compact Edition) Database?
问题 Visual Studio 2005 doesn't provide an interface for creating relationships between tables in a SQL Server CE database (I'm using version 3.0) and you can't open a Compact Edition DB using Management Studio as far as I know. Any ideas? 回答1: Unfortunately there is currently no designer support (unlike for SQL Server 2005) for building relationships between tables in SQL Server CE. To build relationships you need to use SQL commands such as: ALTER TABLE Orders ADD CONSTRAINT FK_Customer_Order