Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is connection string name LocalSqlServer mandatory?

Tags:

asp.net

How do i configure connection string for Asp.Net Membership Provider? Do i have to write it by hand or any tool is available in Visual Studio where i can specify connection string as well as algorithm used to store password?

I read one article and it specifies this connection string :-

<configuration>



    <connectionStrings>

        <remove name=”LocalSqlServer”/>

        <add name="LocalSqlServer" connectionString="Data Source=localhost;Initial Catalog=appservicesdb;Integrated Security=True" providerName="System.Data.SqlClient"/>

    </connectionStrings>



</configuration>

This LocalSqlServer name doesn't sound too intuitive. How do i change this?

Thanks in advance :)

like image 479
TCM Avatar asked Feb 26 '23 03:02

TCM


1 Answers

It's referenced from either your <membership> configuration section

<membership defaultProvider="SqlMembershipProvider" >
  <providers>
    <clear/>
    <add name="MySqlMembershipProvider"
         connectionStringName="LocalSQLServer"
         applicationName="MyAppName"
         type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </providers>
</membership>

or from the place you initialise SqlMembershipProvider in your code.

As far as I can see there's no default - you (or the code example you've copied) must have named it that.

like image 101
Rup Avatar answered Mar 10 '23 22:03

Rup