Setting up the default AspNetSqlProvider to point to remote database

后端 未结 4 1795
春和景丽
春和景丽 2020-12-08 08:50

When starting a new project that required the use of membership providers I found that I could not connect to a remote database that contained the membership database.

4条回答
  •  北海茫月
    2020-12-08 09:13

    After much searching I found that the default Membership Provider specified in machine.config (c:\windows\Microsoft.NET\Framework\v2.0.50727\CONFIG) was always pointing to a SQL Server running on the localhost.

    Instead of modifying machine.config there is a way to set it up in the projects web.config:

    1) Setup the connection string to the remote database

        
          
        
    

    2) In redefine the default provider:

      
        
            
            
        
      
    

    The is key! All the other key/values were taken directly from machine.config

提交回复
热议问题