大家下午好,我遇到了一个问题,从使用C#和Linq to Entities的两个连接字符串中进行选择。目前我有两个连接字符串,它们是:如何从两个连接字符串中选择?
<add name="GameHutDBEntities1" connectionString="metadata=res://*/GameHutModel.csdl|res://*/GameHutModel.ssdl|res://*/GameHutModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=EMMANUEL-PC\SQLEXPRESS;Initial Catalog=GameHutDB;user id=GameHutAdmin; password=123;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
<add name="GameHutDBEntities2" connectionString="metadata=res://*/GameHutModel.csdl|res://*/GameHutModel.ssdl|res://*/GameHutModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=EMMANUEL-PC\SQLEXPRESS;Initial Catalog=GameHutDB;user id=test; password=1234;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
我有两个角色,分别是Admin和Clerk。我如何允许管理员使用第一个连接字符串登录,而职员将使用第二个连接字符串登录?
http://stackoverflow.com/questions/1257107/entity-framework-to-multiple-databases-same-schema-at-runtime – Oded 2011-12-24 15:35:10