简体   繁体   中英

ASP.NET connectionStringName and MemberShip Provider name

"apparently it works"

Can you name reasons beyond good practices not to give these two:

connectionStringName and Membership Provider name the same string value?

could this be an issue?

as in:

  <membership defaultProvider="MySqlConnection" userIsOnlineTimeWindow="45">
         <providers>
            <clear />
            <add name="MySqlConnection" 
            type="System.Web.Security.SqlMembershipProvider"
            connectionStringName="MySqlConnection"

            applicationName="HQChannel" 
            enablePasswordRetrieval="true" 
            enablePasswordReset="true"
            requiresQuestionAndAnswer="false" 
            requiresUniqueEmail="true" 
            passwordFormat="Hashed" 
            minRequiredNonalphanumericCharacters="0"

            minRequiredPasswordLength="6" />
         </providers>
    </membership>

as per this post

Thanks

I wouldn't name it the same as the connection string for the following reasons:

  • I name connection strings with namespace prefixes, so you know which assembly they are related to (eg: MyApp.Web.MySqlConnection)
  • MySqlConnection doesn't imply a MembershipProvider
  • It can introduce confusion

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM