How to create multiple edmx in same project

2019-08-31 03:47发布

问题:

i am new to EF ... getting this error while adding another edmx in same project using same connection string . this is my connection string

<add name="REFLECTIONDBEntities" connectionString="metadata=res://*/;provider=System.Data.SqlClient;provider connection string=&quot;data source=SERVER;initial catalog=REFLECTIONDB;persist security info=True;user id=sa;password=Sqlsa123;multipleactiveresultsets=True;application name=EntityFramework&quot;" />

回答1:

Same connection Strings Names are not allowed, you can have multiple Connection Strings but with separate names.

Change

name="REFLECTIONDBEntities"

To

name="REFLECTIONDBEntities2"