Aug
5
Written by:
MattHunt
8/5/2008 12:46 PM
This is a web.config configuration that allows you to customize the database you are using for your User Role management provider in asp.net 2.0.
<!-- ============================================= -->
<?xml version="1.0" encoding="UTF-8" ?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<connectionStrings>
<remove name="DBWinAuth"/>
<add name="DBWinAuth" connectionString="Data Source=YourDS_ADDRESS;Initial Catalog=YOURDBNAME;Integrated Security=SSPI"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<roleManager enabled="true" />
<authentication mode="Forms" />
<membership defaultProvider="AspNetSqlProvider">
<providers>
<clear />
<add
connectionStringName="DBWinAuth"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
applicationName="/"
requiresUniqueEmail="false"
passwordFormat="Hashed"
description="Stores and retrieves membership data from the specified Microsoft SQL Server database"
minRequiredPasswordLength="5"
minRequiredNonalphanumericCharacters="0"
name="AspNetSqlProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=1.2.3400.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</membership>
</system.web>
</configuration>
<!-- =============================
Also if you are having problems with Visual Studio 2005 seeing your SQL 2005 EE DB Instance Go to Tools--> Options and Select Database Tools --> Data Connections and change the SQL Server Instance Name Accordingly. By default = SQLEXPRESS, but in my case I loaded it at ROOT
Copyright ©2008 Computer Enhancement Professionals
Tags: