Changing default connection string for Membership, Roles, etc
asp.net, asp.net-membership, asp.net-mvc-3, c#
Solution
Yes, these connection strings can be set in web.config:
Membership
<membership defaultProvider="SqlMembershipProvider">
<providers>
<add
name="SqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="MyMembershipConnectionString"
/>
</providers>
</membership>
Roles
<roleManager defaultProvider ="SqlRoleProvider" >
<providers>
<add
name="SqlRoleProvider"
type="System.Web.Security.SqlRoleProvider"
connectionStringName="MyRolesConnectionString"
/>
</providers>
</roleManager>
See here for more info: How to: Use the ASP.NET Membership Provider
Problem
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.