Groups | Blog | Home
all groups > asp.net security > june 2007 >

asp.net security : Problem with Login Control


Juan Romero
6/29/2007 4:12:24 PM
Hi Guys,

I have setup a SQL 2005 DB with ASP.NET membership tables.

Everything seems to work and I am able to connect to this DB (sitting in
different server) because the WSAT allows me to create users and roles.

However, when I place a login control on the application and hit the login
button I get a connection error:

An error has occurred while establishing a connection to the server. When
connecting to SQL Server 2005, this failure may be caused by the fact that
under the default settings SQL Server does not allow remote connections.
(provider: Named Pipes Provider, error: 40 - Could not open a connection to
SQL Server)

I have no idea why this happens. As I understand it the provider is defined
in the web config file and the WSAT uses that information for its interface
so theoretically it should work.

Any help would be much appreciated.

Thank you in advance!



Steve
7/16/2007 7:06:04 AM
The problem is possibly in the membership section of your Web.config. Check
it again; make sure it's pointing to the same connection string as the
profile and role sections. Here is an example of a membership section I
often use:
(some of these settings are not secure enough for a public site however; I
use this for an internal site used only by my team.)

<membership defaultProvider="AppServicesDBMembershipProvider">
<providers>
<remove name="*"/>
<add name="AppServicesDBMembershipProvider"
connectionStringName="AppDBConnection" enablePasswordRetrieval="false"
enablePasswordReset="true" requiresQuestionAndAnswer="false"
applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed"
maxInvalidPasswordAttempts="15" minRequiredPasswordLength="4"
minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
passwordStrengthRegularExpression=""
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</membership>

[quoted text, click to view]
AddThis Social Bookmark Button