connectionstring to sqlmembershipprovider asp.net

时间:2011-10-11 11:18:31

标签: asp.net asp.net-mvc-3

我已将sqlmembershipprovider添加到我的动态数据项目中,以便登录和注册等。

但是,我遇到连接字符串问题。该数据库位于远程sql server 2008数据库服务器上。

下面我有实体的连接字符串:

<add name="xxEntities" 
connectionString="metadata=res://*;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=xx.xx.x.xxx;Initial Catalog=XX;Integrated Security=True;MultipleActiveResultSets=True&quot;" 
providerName="System.Data.EntityClient" />

当我点击会员提供商时,我收到此错误:

不支持关键字:'元数据'。

在这行代码上:

System.Web.Security.Membership.GetAllUsers(0,1,count)

我是否需要为提供商提供单独的连接字符串?或者我应该能够将上述字符串与我的所有连接一起使用,包括我的会员提供者吗?

感谢。

1 个答案:

答案 0 :(得分:0)

尝试使用此connectionString模板+更改用户ID,密码,初始目录

Provider=SQLOLEDB.1;Persist Security Info=True;Data Source=xxx.xxx.xxx.xxx;User ID=RemoteApp;Password=xxx;Initial Catalog=xxx;