Connection Strings for Entity Framework

后端 未结 6 1805
挽巷
挽巷 2020-12-08 04:59

I want to share same Database information across multiple entities in Silverlight.. but I want the connection string to be named xyz and have everyone access that connection

6条回答
  •  孤街浪徒
    2020-12-08 05:51

    What I understand is you want same connection string with different Metadata in it. So you can use a connectionstring as given below and replace "" part. I have used your given connectionString in same sequence.

    connectionString="provider=System.Data.SqlClient;provider connection string="Data Source=SomeServer;Initial Catalog=SomeCatalog;Persist Security Info=True;User ID=Entity;Password=SomePassword;MultipleActiveResultSets=True""
    

    For first connectionString replace with "metadata=res://*/ModEntity.csdl|res://*/ModEntity.ssdl|res://*/ModEntity.msl;"

    For second connectionString replace with "metadata=res://*/Entity.csdl|res://*/Entity.ssdl|res://*/Entity.msl;"

    For third connectionString replace with "metadata=res://*/Entity.csdl|res://*/Entity.ssdl|res://*/Entity.msl|res://*/ModEntity.csdl|res://*/ModEntity.ssdl|res://*/ModEntity.msl;"

    Happy coding!

提交回复
热议问题