ASP.Net Host

ASP.Net Membership Providers

This explains how to install the ASP.Net Membership Providers on your SQL 2005 database. You will need the Membership Providers installed on your database to use the ASP.Net 2.0 Login control.

To generate the script:

On your computer, open the ASP.Net command line and enter:

aspnet_regsql.exe -A all -sqlexportonly runproviders.sql

That generates the basic script for you, and puts into a file called runproviders.sql. Open that file and use the "Edit | Replace" feature of your text editor to replace every instance of "aspnetdb" with your own database name.

Connect to your SQL server and click the "New Script" button in SQL Server Studio, paste the script into the script text editor, and run it.

( *Note: you can also run the script directly from the command line against your remote SQL intance by setting the flags to your server, database, user name and password. Complete details about the command line flags can be found at http://msdn2.microsoft.com/en-us/library/x28wfk74.aspx. )

That has created all your Roles, which you can see under the "Security | Roles" part of your database.

Last part is to give your user account access to the roles with the following script (replace "YourUser" with your database user name), and run this little script. Then you are done with setting up SQL Server 2005 for the ASP.Net 2.0 Providers.

Exec sp_addrolemember 'aspnet_Membership_FullAccess', 'YourUser'

go

Exec sp_addrolemember 'aspnet_Personalization_FullAccess', 'YourUser'

go

Exec sp_addrolemember 'aspnet_Profile_FullAccess', 'YourUser'

go

Exec sp_addrolemember 'aspnet_Roles_FullAccess', 'YourUser'

go

Exec sp_addrolemember 'aspnet_WebEvent_FullAccess', 'YourUser'

go

[ 11/19/2006 ]

0 Comments

Leave your comment.
Name:
Email: (not shared or made public)
Website:   http://
Comments:

This is a public forum. Aquest Solutions and its affiliates are not responsible for, and do not control what is posted herein. Aquest Solutions makes no warranties or guarantees concerning any advice dispensed by its staff, members, or readers.

Community standards in this comment area do not permit hate language, excessive profanity, or other patently offensive language. Please be aware that all information posted to this comment area becomes the property of Aquest Solutions and may be edited and republished in print or electronic format as outlined in Aquest Solutions' Terms of Use.

Important Note: This comment area is NOT intended for commercial messages or solicitations of business.

We recommend Aquest Hosting for your ASP.Net 2.0 hosting, Community Server hosting, and DotNetNuke hosting.