【发布时间】:2011-12-24 15:27:51
【问题描述】:
下午好,我在使用 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" />
我有两个角色,即管理员和文员。如何让管理员使用第一个连接字符串登录,而店员将使用第二个连接字符串登录?
【问题讨论】:
标签: c# asp.net linq-to-entities