By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,244 Members | 1,972 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,244 IT Pros & Developers. It's quick & easy.

Disabling ASP.net 2.0 Membership

P: n/a
Hi,

I am currently working on an asp.net 2.0 web site that is a replacement of a
classic asp web site. The current web site uses a Commerce Server 2002
database for storing user information. It does not currently use any of the
Commerce Server 2002 functionality with the exception of the user
authentication features.

I have written my replacement application to use a custom login form and
custom connection string so that I can use the Commerce Server SQL Server
database instance without modification. My login form works great when
running the application locally through VS 2005. However, I get the nasty
error below when I deploy the application to my development server (which
does not have sql server 2005 express installed).

My environment is setup for SQL Server 2000 running on a separate server and
I have no intention of installing SQL Server 2005 software (express or
otherwise). I am not using the asp.net 2.0 membership features in the least
and have tried to delete the default provider - which asp.net 2.0 won't
allow.

I also don't want to undertake a migration from my Commerce Server
originated membership database because what I have now meets all of my needs.
How can I disable asp.net 2.0 membership functionality while still using
forms authentication and get rid of the problem of the default membership
provider attempting to connect to a SQL Server 2005 database that doesn't
exist?

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)
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: 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)

Source Error:
Line 44:
Line 45: sqlCmd.Connection = cn
Line 46: cn.Open()
Line 47: Dim reader As SqlDataReader = sqlCmd.ExecuteReader()
Line 48: If reader.Read() Then
Source File: D:\Web Content\App_Code\DAL\SqlUserLogin.vb Line: 46

Stack Trace:
[SqlException (0x80131904): 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)]
System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException
exception, Boolean breakConnection) +734995

System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject
stateObj) +188
System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner,
Boolean& failoverDemandDone, String host, String failoverPartner, String
protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean
encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection
owningObject, Boolean aliasLookup) +820

System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection
owningObject, SqlConnectionString connectionOptions, String newPassword,
Boolean redirectedUserInstance) +628

System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity
identity, SqlConnectionString connectionOptions, Object providerInfo, String
newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170

System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions
options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
owningConnection) +359

System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection
owningObject) +424
System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection
owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection
owningObject) +496
System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection
owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
GLSC.UserLoginObjects.SqlUserLogin.Login(String AccountId, String
Password) in D:\Web Content\App_Code\DAL\SqlUserLogin.vb:46
GLSC.BusinessObjects.UserLogin.Login(String AccountId, String Password)
in D:\Web Content\App_Code\BAL\UserLogin.vb:15
login_login.btnLogin_Click(Object sender, EventArgs e) in D:\Web
Content\login\login.aspx.vb:12
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument)
+107

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET
Version:2.0.50727.42
--
Paul
Feb 9 '06 #1
Share this Question
Share on Google+
9 Replies


P: n/a
You can implement your own MembershipProvider.
http://www.15seconds.com/issue/050216.htm
Lets say you don't care about it. That's fine.
Just create your own, and leave all the method implementations as "throw new
NotImplementedException"

The key is to add the config settings, to point to your (dumb/stubbed)
MyMembershipProvider.

That should get rid of your 2005 dependancy.

...

Since you have your own login information, you may want to actually
implement some of your own methods on your MyMembershipProvider.


There are two primary reasons for creating a custom membership provider.

a.. You need to store membership information in a data source that is not
supported by the membership providers included with the .NET Framework, such
as a FoxPro database, an Oracle database, or other data sources.

b.. You need to manage membership information using a database schema that
is different from the database schema used by the providers that ship with
the .NET Framework. A common example of this would be membership data that
already exists in a SQL Server database for a company or Web site.


"Paul Keegstra" <pa***@nospam.nospam> wrote in message
news:62**********************************@microsof t.com...
Hi,

I am currently working on an asp.net 2.0 web site that is a replacement of a classic asp web site. The current web site uses a Commerce Server 2002
database for storing user information. It does not currently use any of the Commerce Server 2002 functionality with the exception of the user
authentication features.

I have written my replacement application to use a custom login form and
custom connection string so that I can use the Commerce Server SQL Server
database instance without modification. My login form works great when
running the application locally through VS 2005. However, I get the nasty
error below when I deploy the application to my development server (which
does not have sql server 2005 express installed).

My environment is setup for SQL Server 2000 running on a separate server and I have no intention of installing SQL Server 2005 software (express or
otherwise). I am not using the asp.net 2.0 membership features in the least and have tried to delete the default provider - which asp.net 2.0 won't
allow.

I also don't want to undertake a migration from my Commerce Server
originated membership database because what I have now meets all of my needs.

How can I disable asp.net 2.0 membership functionality while still using
forms authentication and get rid of the problem of the default membership
provider attempting to connect to a SQL Server 2005 database that doesn't
exist?

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)
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: 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)

Source Error:
Line 44:
Line 45: sqlCmd.Connection = cn
Line 46: cn.Open()
Line 47: Dim reader As SqlDataReader = sqlCmd.ExecuteReader() Line 48: If reader.Read() Then
Source File: D:\Web Content\App_Code\DAL\SqlUserLogin.vb Line: 46

Stack Trace:
[SqlException (0x80131904): 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)]
System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException
exception, Boolean breakConnection) +734995

System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObjec
t stateObj) +188
System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner,
Boolean& failoverDemandDone, String host, String failoverPartner, String
protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean
encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject, Boolean aliasLookup) +820

System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword,
Boolean redirectedUserInstance) +628

System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentit
y identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170
System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOpti
ons options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
owningConnection) +359

System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnec
tion owningConnection, DbConnectionPool pool, DbConnectionOptions options)
+28 System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection
owningObject) +424
System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection
owningObject) +496
System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection
owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
GLSC.UserLoginObjects.SqlUserLogin.Login(String AccountId, String
Password) in D:\Web Content\App_Code\DAL\SqlUserLogin.vb:46
GLSC.BusinessObjects.UserLogin.Login(String AccountId, String Password)
in D:\Web Content\App_Code\BAL\UserLogin.vb:15
login_login.btnLogin_Click(Object sender, EventArgs e) in D:\Web
Content\login\login.aspx.vb:12
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument) +107

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePo
stBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102


-------------------------------------------------------------------------- ------ Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
--
Paul

Feb 9 '06 #2

P: n/a
I checked out the article you referenced and implemented my own provider.

Didn't matter. I still get the same error despite removing the default
provider and the default connection string. What other causes are there for
this error?

--
Paul
"sloan" wrote:
You can implement your own MembershipProvider.
http://www.15seconds.com/issue/050216.htm
Lets say you don't care about it. That's fine.
Just create your own, and leave all the method implementations as "throw new
NotImplementedException"

The key is to add the config settings, to point to your (dumb/stubbed)
MyMembershipProvider.

That should get rid of your 2005 dependancy.

...

Since you have your own login information, you may want to actually
implement some of your own methods on your MyMembershipProvider.


There are two primary reasons for creating a custom membership provider.

a.. You need to store membership information in a data source that is not
supported by the membership providers included with the .NET Framework, such
as a FoxPro database, an Oracle database, or other data sources.

b.. You need to manage membership information using a database schema that
is different from the database schema used by the providers that ship with
the .NET Framework. A common example of this would be membership data that
already exists in a SQL Server database for a company or Web site.


"Paul Keegstra" <pa***@nospam.nospam> wrote in message
news:62**********************************@microsof t.com...
Hi,

I am currently working on an asp.net 2.0 web site that is a replacement of

a
classic asp web site. The current web site uses a Commerce Server 2002
database for storing user information. It does not currently use any of

the
Commerce Server 2002 functionality with the exception of the user
authentication features.

I have written my replacement application to use a custom login form and
custom connection string so that I can use the Commerce Server SQL Server
database instance without modification. My login form works great when
running the application locally through VS 2005. However, I get the nasty
error below when I deploy the application to my development server (which
does not have sql server 2005 express installed).

My environment is setup for SQL Server 2000 running on a separate server

and
I have no intention of installing SQL Server 2005 software (express or
otherwise). I am not using the asp.net 2.0 membership features in the

least
and have tried to delete the default provider - which asp.net 2.0 won't
allow.

I also don't want to undertake a migration from my Commerce Server
originated membership database because what I have now meets all of my

needs.


How can I disable asp.net 2.0 membership functionality while still using
forms authentication and get rid of the problem of the default membership
provider attempting to connect to a SQL Server 2005 database that doesn't
exist?

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)
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information

about
the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: 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)

Source Error:
Line 44:
Line 45: sqlCmd.Connection = cn
Line 46: cn.Open()
Line 47: Dim reader As SqlDataReader =

sqlCmd.ExecuteReader()
Line 48: If reader.Read() Then
Source File: D:\Web Content\App_Code\DAL\SqlUserLogin.vb Line: 46

Stack Trace:
[SqlException (0x80131904): 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)]
System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException
exception, Boolean breakConnection) +734995

System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObjec
t
stateObj) +188
System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner,
Boolean& failoverDemandDone, String host, String failoverPartner, String
protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean
encrypt, Boolean trustServerCert, Boolean integratedSecurity,

SqlConnection
owningObject, Boolean aliasLookup) +820

System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection
owningObject, SqlConnectionString connectionOptions, String newPassword,
Boolean redirectedUserInstance) +628

System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentit
y
identity, SqlConnectionString connectionOptions, Object providerInfo,

String
newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)

+170

System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOpti
ons
options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
owningConnection) +359

System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnec
tion owningConnection, DbConnectionPool pool, DbConnectionOptions options)
+28
System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection
owningObject) +424

System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection
owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection
owningObject) +496
System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection
owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
GLSC.UserLoginObjects.SqlUserLogin.Login(String AccountId, String
Password) in D:\Web Content\App_Code\DAL\SqlUserLogin.vb:46
GLSC.BusinessObjects.UserLogin.Login(String AccountId, String Password)
in D:\Web Content\App_Code\BAL\UserLogin.vb:15
login_login.btnLogin_Click(Object sender, EventArgs e) in D:\Web
Content\login\login.aspx.vb:12
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEven t(String

eventArgument)
+107

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePo
stBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102


--------------------------------------------------------------------------

------
Version Information: Microsoft .NET Framework Version:2.0.50727.42;

ASP.NET
Version:2.0.50727.42
--
Paul


Feb 9 '06 #3

P: n/a
Can you post your web.config file?


"Paul Keegstra" <pa***@nospam.nospam> wrote in message
news:7E**********************************@microsof t.com...
I checked out the article you referenced and implemented my own provider.

Didn't matter. I still get the same error despite removing the default
provider and the default connection string. What other causes are there for this error?

--
Paul
"sloan" wrote:
You can implement your own MembershipProvider.
http://www.15seconds.com/issue/050216.htm
Lets say you don't care about it. That's fine.
Just create your own, and leave all the method implementations as "throw new
NotImplementedException"

The key is to add the config settings, to point to your (dumb/stubbed)
MyMembershipProvider.

That should get rid of your 2005 dependancy.

...

Since you have your own login information, you may want to actually
implement some of your own methods on your MyMembershipProvider.


There are two primary reasons for creating a custom membership provider.

a.. You need to store membership information in a data source that is not supported by the membership providers included with the .NET Framework, such as a FoxPro database, an Oracle database, or other data sources.

b.. You need to manage membership information using a database schema that is different from the database schema used by the providers that ship with the .NET Framework. A common example of this would be membership data that already exists in a SQL Server database for a company or Web site.


"Paul Keegstra" <pa***@nospam.nospam> wrote in message
news:62**********************************@microsof t.com...
Hi,

I am currently working on an asp.net 2.0 web site that is a replacement of
a
classic asp web site. The current web site uses a Commerce Server
2002 database for storing user information. It does not currently use any of the
Commerce Server 2002 functionality with the exception of the user
authentication features.

I have written my replacement application to use a custom login form
and custom connection string so that I can use the Commerce Server SQL Server database instance without modification. My login form works great when running the application locally through VS 2005. However, I get the nasty error below when I deploy the application to my development server (which does not have sql server 2005 express installed).

My environment is setup for SQL Server 2000 running on a separate server and
I have no intention of installing SQL Server 2005 software (express or
otherwise). I am not using the asp.net 2.0 membership features in the

least
and have tried to delete the default provider - which asp.net 2.0
won't allow.

I also don't want to undertake a migration from my Commerce Server
originated membership database because what I have now meets all of my

needs.


How can I disable asp.net 2.0 membership functionality while still using forms authentication and get rid of the problem of the default membership provider attempting to connect to a SQL Server 2005 database that doesn't exist?

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)
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: 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)

Source Error:
Line 44:
Line 45: sqlCmd.Connection = cn
Line 46: cn.Open()
Line 47: Dim reader As SqlDataReader =

sqlCmd.ExecuteReader()
Line 48: If reader.Read() Then
Source File: D:\Web Content\App_Code\DAL\SqlUserLogin.vb Line: 46

Stack Trace:
[SqlException (0x80131904): 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)]
System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException
exception, Boolean breakConnection) +734995

System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObjec t
stateObj) +188
System.Data.SqlClient.TdsParser.Connect(Boolean&
useFailoverPartner, Boolean& failoverDemandDone, String host, String failoverPartner, String protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity,

SqlConnection
owningObject, Boolean aliasLookup) +820

System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection
owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628

System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentit y
identity, SqlConnectionString connectionOptions, Object providerInfo,

String
newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
+170

System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOpti ons
options, Object poolGroupProviderInfo, DbConnectionPool pool,
DbConnection owningConnection) +359

System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnec tion owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection
owningObject) +424

System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection
owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection owningObject) +496
System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
GLSC.UserLoginObjects.SqlUserLogin.Login(String AccountId, String
Password) in D:\Web Content\App_Code\DAL\SqlUserLogin.vb:46
GLSC.BusinessObjects.UserLogin.Login(String AccountId, String Password) in D:\Web Content\App_Code\BAL\UserLogin.vb:15
login_login.btnLogin_Click(Object sender, EventArgs e) in D:\Web
Content\login\login.aspx.vb:12
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEven t(String

eventArgument)
+107

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePo stBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

--------------------------------------------------------------------------
------
Version Information: Microsoft .NET Framework Version:2.0.50727.42;

ASP.NET
Version:2.0.50727.42
--
Paul


Feb 9 '06 #4

P: n/a
sure:

<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
</appSettings>
<connectionStrings>
<add name="Conn2.ConnectionString"
connectionString="Server=myserver;Database=members hipdb;User
ID=tester;Password=pwd;Persist Security Info=false;"/>
<add name="Conn1.ConnectionString"
connectionString="Server=myserver;Database=testdb; User
ID=tester;Password=pwd;Persist Security Info=false;"/>
</connectionStrings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.

Visual Basic options:
Set strict="true" to disallow all data type conversions
where data loss can occur.
Set explicit="true" to force declaration of all variables.
-->
<compilation debug="true" strict="false" explicit="true"/>
<authorization>
<allow users="?"/>
<allow users="*"/>
</authorization>
<pages theme="Default">
<namespaces>
<clear/>
<add namespace="System"/>
<add namespace="System.Collections"/>
<add namespace="System.Collections.Specialized"/>
<add namespace="System.Configuration"/>
<add namespace="System.Text"/>
<add namespace="System.Text.RegularExpressions"/>
<add namespace="System.Web"/>
<add namespace="System.Web.Caching"/>
<add namespace="System.Web.SessionState"/>
<add namespace="System.Web.Security"/>
<add namespace="System.Web.Profile"/>
<add namespace="System.Web.UI"/>
<add namespace="System.Web.UI.WebControls"/>
<add namespace="System.Web.UI.WebControls.WebParts"/>
<add namespace="System.Web.UI.HtmlControls"/>
</namespaces>
</pages>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Forms">
<forms loginUrl="~/login/login.aspx" name="myAuthCookie" protection="All"
timeout="60" path="/"/>
</authentication>
<membership defaultProvider="MyMembershipProvider">
<providers>
<clear />
<add name="MyMembershipProvider"
type="GLSC.Membership.MyCustomMembershipProvider"
enablePasswordRetrieval="false"
enablePasswordReset="false"
requiresQuestionAndAnswer="false"
applicationName="/"
requiresUniqueEmail="false"
passwordFormat="Clear" />
</providers>
</membership>
<!--
The <customerrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customerrors mode="RemoteOnly"
defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customerrors>
-->
</system.web>
<location path="coordinators">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>
</configuration>

--
Paul
"sloan" wrote:
Can you post your web.config file?


"Paul Keegstra" <pa***@nospam.nospam> wrote in message
news:7E**********************************@microsof t.com...
I checked out the article you referenced and implemented my own provider.

Didn't matter. I still get the same error despite removing the default
provider and the default connection string. What other causes are there

for
this error?

--
Paul
"sloan" wrote:
You can implement your own MembershipProvider.
http://www.15seconds.com/issue/050216.htm
Lets say you don't care about it. That's fine.
Just create your own, and leave all the method implementations as "throw new NotImplementedException"

The key is to add the config settings, to point to your (dumb/stubbed)
MyMembershipProvider.

That should get rid of your 2005 dependancy.

...

Since you have your own login information, you may want to actually
implement some of your own methods on your MyMembershipProvider.


There are two primary reasons for creating a custom membership provider.

a.. You need to store membership information in a data source that is not supported by the membership providers included with the .NET Framework, such as a FoxPro database, an Oracle database, or other data sources.

b.. You need to manage membership information using a database schema that is different from the database schema used by the providers that ship with the .NET Framework. A common example of this would be membership data that already exists in a SQL Server database for a company or Web site.


"Paul Keegstra" <pa***@nospam.nospam> wrote in message
news:62**********************************@microsof t.com...
> Hi,
>
> I am currently working on an asp.net 2.0 web site that is a replacement of a
> classic asp web site. The current web site uses a Commerce Server 2002 > database for storing user information. It does not currently use any of the
> Commerce Server 2002 functionality with the exception of the user
> authentication features.
>
> I have written my replacement application to use a custom login form and > custom connection string so that I can use the Commerce Server SQL Server > database instance without modification. My login form works great when > running the application locally through VS 2005. However, I get the nasty > error below when I deploy the application to my development server (which > does not have sql server 2005 express installed).
>
> My environment is setup for SQL Server 2000 running on a separate server and
> I have no intention of installing SQL Server 2005 software (express or
> otherwise). I am not using the asp.net 2.0 membership features in the
least
> and have tried to delete the default provider - which asp.net 2.0 won't > allow.
>
> I also don't want to undertake a migration from my Commerce Server
> originated membership database because what I have now meets all of my
needs.
>
>
> How can I disable asp.net 2.0 membership functionality while still using > forms authentication and get rid of the problem of the default membership > provider attempting to connect to a SQL Server 2005 database that doesn't > exist?
>
> 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)
> Description: An unhandled exception occurred during the execution of the > current web request. Please review the stack trace for more information about
> the error and where it originated in the code.
>
> Exception Details: System.Data.SqlClient.SqlException: 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)
>
> Source Error:
>
>
> Line 44:
> Line 45: sqlCmd.Connection = cn
> Line 46: cn.Open()
> Line 47: Dim reader As SqlDataReader =
sqlCmd.ExecuteReader()
> Line 48: If reader.Read() Then
>
>
> Source File: D:\Web Content\App_Code\DAL\SqlUserLogin.vb Line: 46
>
> Stack Trace:
>
>
> [SqlException (0x80131904): 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)]
> System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException
> exception, Boolean breakConnection) +734995
>
>
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObjec t
> stateObj) +188
> System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner, > Boolean& failoverDemandDone, String host, String failoverPartner, String > protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean > encrypt, Boolean trustServerCert, Boolean integratedSecurity,
SqlConnection
> owningObject, Boolean aliasLookup) +820
>
>
System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection > owningObject, SqlConnectionString connectionOptions, String newPassword, > Boolean redirectedUserInstance) +628
>
>
System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentit y
> identity, SqlConnectionString connectionOptions, Object providerInfo,
String
> newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170
>
>
System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOpti ons
> options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection > owningConnection) +359
>
>
System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnec tion owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
> System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection
> owningObject) +424
>
System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection
> owningObject) +66
> System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection > owningObject) +496
> System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection > owningConnection) +82
> System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection > outerConnection, DbConnectionFactory connectionFactory) +105
> System.Data.SqlClient.SqlConnection.Open() +111
> GLSC.UserLoginObjects.SqlUserLogin.Login(String AccountId, String
> Password) in D:\Web Content\App_Code\DAL\SqlUserLogin.vb:46
> GLSC.BusinessObjects.UserLogin.Login(String AccountId, String Password) > in D:\Web Content\App_Code\BAL\UserLogin.vb:15
> login_login.btnLogin_Click(Object sender, EventArgs e) in D:\Web
> Content\login\login.aspx.vb:12
> System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
> System.Web.UI.WebControls.Button.RaisePostBackEven t(String
eventArgument)
> +107
>
>
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePo stBackEvent(String eventArgument) +7
> System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
> sourceControl, String eventArgument) +11
> System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33 > System.Web.UI.Page.ProcessRequestMain(Boolean
> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102 >
>
>
>

--------------------------------------------------------------------------
------
> Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET
> Version:2.0.50727.42
>
>
> --
> Paul


Feb 9 '06 #5

P: n/a
Hi Paul,

I've just looked the configure XML content you provided and haven't found
anything incorrect. Also, from the exception callstack you posted in the
first message, we can get the following period:

==================
GLSC.UserLoginObjects.SqlUserLogin.Login(String AccountId, String
Password) in D:\Web Content\App_Code\DAL\SqlUserLogin.vb:46
GLSC.BusinessObjects.UserLogin.Login(String AccountId, String Password)
in D:\Web Content\App_Code\BAL\UserLogin.vb:15
login_login.btnLogin_Click(Object sender, EventArgs e) in D:\Web
Content\login\login.aspx.vb:12
=================

What's the "GLSC.UserLoginObjects.SqlUserLogin.Login", I assume it is your
custom MembershipProvider's calling component classes, correct? If so, I
think your custom custom provider has been correctly configured and the
ASP.NET runtime has been able to call into it. The exception is likely
occured during the connection establishing of your custom
membershipprovider's database...
I think you can concentrate on this if this is the case.

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Feb 10 '06 #6

P: n/a
are you dragging controls onto webforms..
like the <asp:Login> control?

If you drag these unto your form....it IS going to use a MembershipProvider,
whether its the default one, or custom one you create.

Here is my web.config


<system.web>
<membership defaultProvider="InfoManagerMembershipProvider">
<providers>
<add name="InfoManagerMembershipProvider"

type="GranadaCoder.Security.Framework.Membership.I nfoManagerMembershipProvid
er,GranadaCoder.Security.Framework"
description="My Description"

/>
</providers>
</membership>

</system.web>

which doesn't look much different from yours.

...

If you're using any of the "drag and drop" 2.0 asp.net controls, then its
going to want to have a legit MembershipProvider.


"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:KB*************@TK2MSFTNGXA01.phx.gbl...
Hi Paul,

I've just looked the configure XML content you provided and haven't found
anything incorrect. Also, from the exception callstack you posted in the
first message, we can get the following period:

==================
GLSC.UserLoginObjects.SqlUserLogin.Login(String AccountId, String
Password) in D:\Web Content\App_Code\DAL\SqlUserLogin.vb:46
GLSC.BusinessObjects.UserLogin.Login(String AccountId, String Password)
in D:\Web Content\App_Code\BAL\UserLogin.vb:15
login_login.btnLogin_Click(Object sender, EventArgs e) in D:\Web
Content\login\login.aspx.vb:12
=================

What's the "GLSC.UserLoginObjects.SqlUserLogin.Login", I assume it is your custom MembershipProvider's calling component classes, correct? If so, I
think your custom custom provider has been correctly configured and the
ASP.NET runtime has been able to call into it. The exception is likely
occured during the connection establishing of your custom
membershipprovider's database...
I think you can concentrate on this if this is the case.

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Feb 10 '06 #7

P: n/a
Thanks for the posts. To clarify, I am not using any of the login controls
provided by ASP.net 2.0. Also Steven's post is correct that the exception is
being thrown when I am connecting to my remote Commerce Server database
(which currently hosts my user account information).

The thing that has me confused is why my exception text is referencing a
failure to connect to SQL Server 2005 over Named Pipes. I'm not using any
SQL Server 2005 edition, my connection string to my remote database works
just fine (over tcp/ip not named pipes) from within Visual Studio and I can
connect to the remote server from my development server using SQL Query
Analyzer and the username and password I'm specifying in my config file.

I've gone as far as to edit the machine.config to remove the default local
server connection (which does attempt to attach to a local sqlexpress
instance). I've done everything I can think of to remove SQLExpress 2005
from the picture, but the text of the error never changes, nor is the config
file incorrect when run from within the Visual Studio debugger.

Any thoughts?
--
Paul
"sloan" wrote:
are you dragging controls onto webforms..
like the <asp:Login> control?

If you drag these unto your form....it IS going to use a MembershipProvider,
whether its the default one, or custom one you create.

Here is my web.config


<system.web>
<membership defaultProvider="InfoManagerMembershipProvider">
<providers>
<add name="InfoManagerMembershipProvider"

type="GranadaCoder.Security.Framework.Membership.I nfoManagerMembershipProvid
er,GranadaCoder.Security.Framework"
description="My Description"

/>
</providers>
</membership>

</system.web>

which doesn't look much different from yours.

...

If you're using any of the "drag and drop" 2.0 asp.net controls, then its
going to want to have a legit MembershipProvider.


"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:KB*************@TK2MSFTNGXA01.phx.gbl...
Hi Paul,

I've just looked the configure XML content you provided and haven't found
anything incorrect. Also, from the exception callstack you posted in the
first message, we can get the following period:

==================
GLSC.UserLoginObjects.SqlUserLogin.Login(String AccountId, String
Password) in D:\Web Content\App_Code\DAL\SqlUserLogin.vb:46
GLSC.BusinessObjects.UserLogin.Login(String AccountId, String Password)
in D:\Web Content\App_Code\BAL\UserLogin.vb:15
login_login.btnLogin_Click(Object sender, EventArgs e) in D:\Web
Content\login\login.aspx.vb:12
=================

What's the "GLSC.UserLoginObjects.SqlUserLogin.Login", I assume it is

your
custom MembershipProvider's calling component classes, correct? If so, I
think your custom custom provider has been correctly configured and the
ASP.NET runtime has been able to call into it. The exception is likely
occured during the connection establishing of your custom
membershipprovider's database...
I think you can concentrate on this if this is the case.

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Feb 10 '06 #8

P: n/a
Well on a whim I tried moving my database to another database server and
updated my connection string. Since that worked, it would appear that I have
a connectivity issue between my application server and original dataase
server rather than a .net framework or configuration issue.

Thanks for the helpful posts. By the way, the text in the exception message
(original post) probably relates to a 'best suggestion' from Microsoft as to
the most likely cause. Unfortunately, it's not the only cause of this
particular error.

Regards,

--
Paul
"Paul Keegstra" wrote:
Thanks for the posts. To clarify, I am not using any of the login controls
provided by ASP.net 2.0. Also Steven's post is correct that the exception is
being thrown when I am connecting to my remote Commerce Server database
(which currently hosts my user account information).

The thing that has me confused is why my exception text is referencing a
failure to connect to SQL Server 2005 over Named Pipes. I'm not using any
SQL Server 2005 edition, my connection string to my remote database works
just fine (over tcp/ip not named pipes) from within Visual Studio and I can
connect to the remote server from my development server using SQL Query
Analyzer and the username and password I'm specifying in my config file.

I've gone as far as to edit the machine.config to remove the default local
server connection (which does attempt to attach to a local sqlexpress
instance). I've done everything I can think of to remove SQLExpress 2005
from the picture, but the text of the error never changes, nor is the config
file incorrect when run from within the Visual Studio debugger.

Any thoughts?
--
Paul
"sloan" wrote:
are you dragging controls onto webforms..
like the <asp:Login> control?

If you drag these unto your form....it IS going to use a MembershipProvider,
whether its the default one, or custom one you create.

Here is my web.config


<system.web>
<membership defaultProvider="InfoManagerMembershipProvider">
<providers>
<add name="InfoManagerMembershipProvider"

type="GranadaCoder.Security.Framework.Membership.I nfoManagerMembershipProvid
er,GranadaCoder.Security.Framework"
description="My Description"

/>
</providers>
</membership>

</system.web>

which doesn't look much different from yours.

...

If you're using any of the "drag and drop" 2.0 asp.net controls, then its
going to want to have a legit MembershipProvider.


"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:KB*************@TK2MSFTNGXA01.phx.gbl...
Hi Paul,

I've just looked the configure XML content you provided and haven't found
anything incorrect. Also, from the exception callstack you posted in the
first message, we can get the following period:

==================
GLSC.UserLoginObjects.SqlUserLogin.Login(String AccountId, String
Password) in D:\Web Content\App_Code\DAL\SqlUserLogin.vb:46
GLSC.BusinessObjects.UserLogin.Login(String AccountId, String Password)
in D:\Web Content\App_Code\BAL\UserLogin.vb:15
login_login.btnLogin_Click(Object sender, EventArgs e) in D:\Web
Content\login\login.aspx.vb:12
=================

What's the "GLSC.UserLoginObjects.SqlUserLogin.Login", I assume it is

your
custom MembershipProvider's calling component classes, correct? If so, I
think your custom custom provider has been correctly configured and the
ASP.NET runtime has been able to call into it. The exception is likely
occured during the connection establishing of your custom
membershipprovider's database...
I think you can concentrate on this if this is the case.

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Feb 10 '06 #9

P: n/a
Thanks for your followup Paul,

Glad that you've made it work now. If there're any further things we can
help, please feel free to post here also.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Feb 13 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.