[2.0] connection string and XXXprovider

L

Lloyd Dupont

I'm trying to understand ASP.NET 2.0 integrated
security/login/profile/etc.....

Running the Admin tool I get this added in my config file:
<membership defaultProvider="AspNetSqlProvider" />
<profile defaultProvider="AspNetSqlProvider" />
<roleManager enabled="true" defaultProvider="AspNetSqlProvider" />
<siteCounters defaultProvider="AspNetSqlProvider" />

Now I want to setup a SqlSconncetion String for the the AspNetProvider,
trying to read some documentation I read that I could do:
<roleManager defaultProvider="AspNetSqlProvider">
<providers>
<add name="AspNetSqlProvider"
type="System.Web.Security.SqlRoleProvider, System.Web,
Version=1.2.3300.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"
description=" description here "
connectionStringName="[name in <connectionStrings/>" />
</providers>
</roleManager>

due to the hierarchical nature of this declaration I guess I had to copy
paste this declaration 4 times (1 for each membership, profile, roleManager,
siteCounter), it's really cumbersome & error prone.

Isn't there a way to declare the provider somewhere once and for all, and
then just use its name in all feature, without having to declare it again
(and again)?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top