I entered my project using the new ADO.Net Entity Data Model was introduced and added tables to the model using the Refresh Wizard. The design surface now included five of the chosen tables. Two more tables won't add. The wizard asks me to choose them, and once I click Finish, they never appear on the design area.
Is this a glitch, or is it sometimes impossible to add a table to the model (by design)?
UPDATE: The issue is shown in the XML (*.edmx).
<!--Errors Found During Generation: warning 6013: The table/view 'FooBar.dbo.Roles' does not have a primary key defined and no valid primary key could be inferred. This table/view has been excluded. To use the entity you will need to review your schema, add the correct keys and uncomment it.--> <!--<EntityType Name="Roles"> <Property Name="role_id" Type="decimal" /> <Property Name="role_desc" Type="nvarchar" MaxLength="30" /> </EntityType>-->
The entity model is distinct from the design surface. A table in your EDMX mapping that does not show up on the design surface is feasible. To check whether this is the case, open the file as XML. Since the tables are already a part of the entity model in this situation, the Update Wizard will not let you add them again. In general, the Update Wizard is more knowledgeable about your entity model than it is about the design surface.
Although I don't believe it really describes your scenario, it should give you a broad notion of how to proceed: seek for references to the relevant tables in the XML.
Set Primary Keys to all tables or leave only one column's "Allow null" checkbox unchecked in each table. It functions for me: