Thursday, January 10, 2008

Implement a custom role provider in Asp.Net

Installing the Database using Aspnet_regsql.exe
ASP.NET includes a tool for installing the SQL Server database used by the SQL Server providers, named Aspnet_regsql.exe. The Aspnet_regsql.exe tool is located in the drive:\WINDOWS\Microsoft.NET\Framework\versionNumber folder on your Web server. Aspnet_regsql.exe is used to both create the SQL Server database and add or remove options from an existing database.

You can run Aspnet_regsql.exe without any command line arguments to run a wizard that will walk you through specifying connection information for the computer running SQL Server and installing or removing the database elements for all the supported features. You can also run Aspnet_regsql.exe as a command-line tool to specify database elements for individual features to add or remove.
http://msdn2.microsoft.com/en-us/library/x28wfk74.aspx
http://www.dotnetheaven.com/Uploadfile/amit_agrl/EnablingMembershipProviderforSQLServer200502242006014742AM/EnablingMembershipProviderforSQLServer2005.aspx


type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="LocalSqlServer" enablePasswordRetrieval="false"
enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/"
requiresUniqueEmail="false" passwordFormat="Hashed"
maxInvalidPasswordAttempts="5" passwordAttemptWindow="10"
passwordStrengthRegularExpression=""
/>

If you observe the above, you will
notice that the membership provider above "AspNetSqlMembershipProvider" uses a
connection string LocalServer. If you search for LocalServer in the
machine.config file you can see that the same points to the local SQL Express
database.


connectionString="data source=.\SQLEXPRESS;Integrated
Security=SSPI;AttachDBFilename=DataDirectoryaspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
>

No comments: