简体   繁体   中英

ASP.Net Membership SQL Server

I've just run the aspnet_regsql tool and setup aspnetdb on a test server. I've setup the Membership stuff in web.config, and I'm trying to administer it via "Project -> ASP.net Configuration" menu item in Visual Studio 2008.

The first few pages pull up just fine -- the default page and the security page. It shows me that I have 0 users and 0 roles. I was able to click on "Enable Role Manager" or whatever it said. In my connection string I'm connecting as the sa user.

When I click on "Create or Manage Roles" I get an error: "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible." etc, about how the server may not be reachable.

Well, I think it is able to get to the server since it shows me that I have 0 users and roles. If it was unable to get there, in past experience, it would show blank instead of 0.

I know that there are many stored procs and functions installed in SQL to support membership, so is it possible that the sa user doesn't have the rights to execute these things? How would I check? I'm really not good at SQL security, as is evidenced by me using the SA username and password.

Any ideas?

according to my experience this thing is impossible. but if you insist on it you can check it your self .

check that sa user have the ASPNETDB owner privilege(by default sa user have all database owner privilege)

good luck dude

http://forums.asp.net/t/978442.aspx/1

Most of the way down the page, here is the code you need to have in your web.config

<roleManager enabled="true" defaultProvider="SqlRoleProvider">
    <providers>
        <clear/>
        <add name="SqlRoleProvider" applicationName="TestItAll" connectionStringName="aspnetdbConnectionString" type="System.Web.Security.SqlRoleProvider"/>
    </providers>
</roleManager>

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