更改成员资格、角色等的默认连接字符串
默认情况下,我的 Web 应用程序似乎使用 LocalSqlServer
作为连接字符串,用于任何应用程序服务,例如成员资格/角色/身份验证/等。
有什么方法可以更改默认连接字符串应该是什么?默认值是“LocalSqlServer”似乎很随意,我能够找到它的唯一方法是通过谷歌搜索大约两个小时。
我不想被迫将我的服务器连接命名为“LocalSqlServer”,并且我不知道这是否是我可能会覆盖的预先存在的项目。
By default, it seems like my web application is using LocalSqlServer
as the connection string to use for any application services such as Membership/Roles/Authentication/etc.
Is there any way I can change what the default connection string should be? It seems so arbitrary that the default is "LocalSqlServer" and the only way I was able to find this was by googling for this for about two hours.
I don't want to be forced to have to name my server connection "LocalSqlServer" and I have no idea if this is a preexisting item that I might be overwriting.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,可以在 web.config 中设置这些连接字符串:
成员资格
角色
请参阅此处了解更多信息:如何:使用 ASP.NET 成员资格提供程序
Yes, these connection strings can be set in web.config:
Membership
Roles
See here for more info: How to: Use the ASP.NET Membership Provider
2件事。
在您的会员配置中查找或添加“connectionStringName”属性。
这是一个使用它的示例
,当然你需要设置 conn sting
2 things.
Look for, or add a "connectionStringName" property in your membership config.
Here is an example that uses it
And you need to setup the conn sting of course