473,390 Members | 1,454 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,390 software developers and data experts.

ERROR: Provider Management - Could not establish a connection to the database.

Ted
In WSAT, I get the following error when trying to set up my provider:

Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web Site
Administration tool, use the aspnet_regsql command-line utility to
create and configure the database, and then return to this tool to set
the provider.

On Windows XP Pro, I am using MS Visual Studio 2005, and I am using
the developer's edition of MS SQL Server 2005 and NOT MS SQL SERVER
2005 EXPRESS!

I used the aspnet_regsql tool and it did create the database in SQL
Server 2005 without difficulty. If I open the instance of SQL Server
2005 I used, I can see the database it created.

How to I tell WSAT to use SQL Server 2005 instance of SQL Server 2005
Express?

I assume there is a connection string hiding somewhere, but where is
it. It is certainly not in the default web.config file. That file is
mostly empty! In fact, the file Visual Studio created for me contains
only the following:

<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/
v2.0">
</configuration>

What I will aim for, eventually, is to specify the machine and
instance name (or even to specify another database product such as
MySQL or PostgreSQL, if that is possible - MySQL provides .NET, but I
haven't found that for PostgreSQL). Can any data provider be used to
support the login process?

Thanks

Ted

Jan 29 '07 #1
3 13332
Ted,

If you dont see entries for <connectionStringsand <membershipsettings in
you app's web.config then check your machine.config file. If not there, then
check for a web.config at your root web level.

Your machine and root web configs are probably located at:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONF IG\

You can either change your settings in the machine.config or override them
for just your app in your application's web.config. If you decide to
override the defaults by using your web.config then also make sure to clear
the providers settings and specify a value for the applicationName tag.

In your web.config...

<connectionStrings>
<add
name="MyAspnetDB"
connectionString="data source=.\SQLEXPRESS;Integrated
Security=SSPI;AttachDBFilename=|DataDirectory|aspn etdb.mdf;User Instance=true"
providerName="System.Data.SqlClient"
/>

</connectionStrings>

<system.web>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="MyAspnetDB"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
applicationName="MyApplicationName"
requiresUniqueEmail="true"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1"
passwordAttemptWindow="10"
passwordStrengthRegularExpression="" />
</providers>
</membership>
</system.web>

Hope this helps,
Jason Vermillion

"Ted" wrote:
In WSAT, I get the following error when trying to set up my provider:

Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web Site
Administration tool, use the aspnet_regsql command-line utility to
create and configure the database, and then return to this tool to set
the provider.

On Windows XP Pro, I am using MS Visual Studio 2005, and I am using
the developer's edition of MS SQL Server 2005 and NOT MS SQL SERVER
2005 EXPRESS!

I used the aspnet_regsql tool and it did create the database in SQL
Server 2005 without difficulty. If I open the instance of SQL Server
2005 I used, I can see the database it created.

How to I tell WSAT to use SQL Server 2005 instance of SQL Server 2005
Express?

I assume there is a connection string hiding somewhere, but where is
it. It is certainly not in the default web.config file. That file is
mostly empty! In fact, the file Visual Studio created for me contains
only the following:

<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/
v2.0">
</configuration>

What I will aim for, eventually, is to specify the machine and
instance name (or even to specify another database product such as
MySQL or PostgreSQL, if that is possible - MySQL provides .NET, but I
haven't found that for PostgreSQL). Can any data provider be used to
support the login process?

Thanks

Ted

Jan 30 '07 #2
Ted
On Jan 30, 5:01 pm, Jason Vermillion
<JasonVermill...@discussions.microsoft.comwrote:
Ted,

If you dont see entries for <connectionStringsand <membershipsettings in
you app's web.config then check your machine.config file. If not there, then
check for a web.config at your root web level.

Your machine and root web configs are probably located at:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONF IG\

You can either change your settings in the machine.config or override them
for just your app in your application's web.config. If you decide to
override the defaults by using your web.config then also make sure to clear
the providers settings and specify a value for the applicationName tag.

In your web.config...

<connectionStrings>
<add
name="MyAspnetDB"
connectionString="data source=.\SQLEXPRESS;Integrated
Security=SSPI;AttachDBFilename=|DataDirectory|aspn etdb.mdf;User Instance=true"
providerName="System.Data.SqlClient"
/>

</connectionStrings>

<system.web>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="MyAspnetDB"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
applicationName="MyApplicationName"
requiresUniqueEmail="true"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1"
passwordAttemptWindow="10"
passwordStrengthRegularExpression="" />
</providers>
</membership>
</system.web>

Hope this helps,
Jason Vermillion

"Ted" wrote:
In WSAT, I get the following error when trying to set up my provider:
Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web Site
Administration tool, use the aspnet_regsql command-line utility to
create and configure the database, and then return to this tool to set
the provider.
On Windows XP Pro, I am using MS Visual Studio 2005, and I am using
the developer's edition of MS SQL Server 2005 and NOT MS SQL SERVER
2005 EXPRESS!
I used the aspnet_regsql tool and it did create the database in SQL
Server 2005 without difficulty. If I open the instance of SQL Server
2005 I used, I can see the database it created.
How to I tell WSAT to use SQL Server 2005 instance of SQL Server 2005
Express?
I assume there is a connection string hiding somewhere, but where is
it. It is certainly not in the default web.config file. That file is
mostly empty! In fact, the file Visual Studio created for me contains
only the following:
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/
v2.0">
</configuration>
What I will aim for, eventually, is to specify the machine and
instance name (or even to specify another database product such as
MySQL or PostgreSQL, if that is possible - MySQL provides .NET, but I
haven't found that for PostgreSQL). Can any data provider be used to
support the login process?
Thanks
Ted- Hide quoted text -

- Show quoted text -
Hi Jason,

Thanks. I have been able to make some progress, but I am not quite
there yet. Here is the error message I get now:
A connection was successfully established with the server, but then an
error occurred during the login process. (provider: Shared Memory
Provider, error: 0 - No process is on the other end of the pipe.)
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: A connection
was successfully established with the server, but then an error
occurred during the login process. (provider: Shared Memory Provider,
error: 0 - No process is on the other end of the pipe.)

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace
below.
I have not providedd the stack trace here, but my guess is that I have
misconfigured the provider to expect to connect to SQL Server using
pipes and I have the server configured to connect using TCP/IP. WHen
I connect to the database, using SQL Server authentication and the
credentials I created for my ASP projects, and using my other
development tools, I connect easily. Here is what I have now in the
machine config file:

<connectionStrings>
<add name="LocalSqlServer" connectionString="data
source=.;Integrated Security=SSPI;User ID=aspuserid;Password=my-
password;User Instance=true" providerName="System.Data.SqlClient" />
</connectionStrings>
and ...

<membership>
<providers>
<add name="AspNetSqlMembershipProvider"
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"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1"
passwordAttemptWindow="10"
passwordStrengthRegularExpression="" />
</providers>
</membership>
SO, are these the sections of the config file that determines whether
the ASP app authentication pages try to use pipes or TCP/IP to connect
to the database back end? If so, what did I get wrong. If not, where
do I look and what do I change? Is it the .NET framework that decides
this or IIS?

Can I use other RDBMS backends? I have installed MySQL and
MySQL's .NET add-on, and have already used it to connect simple
ASP.NET web pages to a database I maintain in MySQL, and that on a
different machine from my development machine. If I can, will
aspnet_regsql work with MySQL or is it SQL Server only? Alas, the
books I have don't talk about this and I have not yet found the right
place in the documentation that came with Visual Studio 2005 to find
these details.

Thanks again.

Ted

Feb 5 '07 #3
Ted
On Feb 4, 10:46 pm, "Ted" <r.ted.by...@rogers.comwrote:
On Jan 30, 5:01 pm, Jason Vermillion

<JasonVermill...@discussions.microsoft.comwrote:
Ted,
If you dont see entries for <connectionStringsand <membershipsettings in
you app's web.config then check your machine.config file. If not there, then
check for a web.config at your root web level.
Your machine and root web configs are probably located at:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONF IG\
You can either change your settings in the machine.config or override them
for just your app in your application's web.config. If you decide to
override the defaults by using your web.config then also make sure to clear
the providers settings and specify a value for the applicationName tag.
In your web.config...
<connectionStrings>
<add
name="MyAspnetDB"
connectionString="data source=.\SQLEXPRESS;Integrated
Security=SSPI;AttachDBFilename=|DataDirectory|aspn etdb.mdf;User Instance=true"
providerName="System.Data.SqlClient"
/>
</connectionStrings>
<system.web>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="MyAspnetDB"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
applicationName="MyApplicationName"
requiresUniqueEmail="true"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1"
passwordAttemptWindow="10"
passwordStrengthRegularExpression="" />
</providers>
</membership>
</system.web>
Hope this helps,
Jason Vermillion
"Ted" wrote:
In WSAT, I get the following error when trying to set up my provider:
Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web Site
Administration tool, use the aspnet_regsql command-line utility to
create and configure the database, and then return to this tool to set
the provider.
On Windows XP Pro, I am using MS Visual Studio 2005, and I am using
the developer's edition of MS SQL Server 2005 and NOT MS SQL SERVER
2005 EXPRESS!
I used the aspnet_regsql tool and it did create the database in SQL
Server 2005 without difficulty. If I open the instance of SQL Server
2005 I used, I can see the database it created.
How to I tell WSAT to use SQL Server 2005 instance of SQL Server 2005
Express?
I assume there is a connection string hiding somewhere, but where is
it. It is certainly not in the default web.config file. That file is
mostly empty! In fact, the file Visual Studio created for me contains
only the following:
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/
v2.0">
</configuration>
What I will aim for, eventually, is to specify the machine and
instance name (or even to specify another database product such as
MySQL or PostgreSQL, if that is possible - MySQL provides .NET, but I
haven't found that for PostgreSQL). Can any data provider be used to
support the login process?
Thanks
Ted- Hide quoted text -
- Show quoted text -

Hi Jason,

Thanks. I have been able to make some progress, but I am not quite
there yet. Here is the error message I get now:

A connection was successfully established with the server, but then an
error occurred during the login process. (provider: Shared Memory
Provider, error: 0 - No process is on the other end of the pipe.)
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: A connection
was successfully established with the server, but then an error
occurred during the login process. (provider: Shared Memory Provider,
error: 0 - No process is on the other end of the pipe.)

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace
below.

I have not providedd the stack trace here, but my guess is that I have
misconfigured the provider to expect to connect to SQL Server using
pipes and I have the server configured to connect using TCP/IP. WHen
I connect to the database, using SQL Server authentication and the
credentials I created for my ASP projects, and using my other
development tools, I connect easily. Here is what I have now in the
machine config file:

<connectionStrings>
<add name="LocalSqlServer" connectionString="data
source=.;Integrated Security=SSPI;User ID=aspuserid;Password=my-
password;User Instance=true" providerName="System.Data.SqlClient" />
</connectionStrings>

and ...

<membership>
<providers>
<add name="AspNetSqlMembershipProvider"
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"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1"
passwordAttemptWindow="10"
passwordStrengthRegularExpression="" />
</providers>
</membership>

SO, are these the sections of the config file that determines whether
the ASP app authentication pages try to use pipes or TCP/IP to connect
to the database back end? If so, what did I get wrong. If not, where
do I look and what do I change? Is it the .NET framework that decides
this or IIS?

Can I use other RDBMS backends? I have installed MySQL and
MySQL's .NET add-on, and have already used it to connect simple
ASP.NET web pages to a database I maintain in MySQL, and that on a
different machine from my development machine. If I can, will
aspnet_regsql work with MySQL or is it SQL Server only? Alas, the
books I have don't talk about this and I have not yet found the right
place in the documentation that came with Visual Studio 2005 to find
these details.

Thanks again.

Ted- Hide quoted text -

- Show quoted text -
OK, now I am completely confused. I do not understand!

I changed the following, having read that integrated security uses
Windows authentication to connect to SQL Server and I require the app
to use SQL Server authentication.

Integrated Security=false

And I changed the following in response to an error message I received
(to the effect that the user instance flag is not supported with this
provider) once I made the above change.

User Instance=false

Once I made these two changes, everything works fine. How what do the
changes I made have to do with the error I describe in my previous
post about the application not being able to use pipes to talk to SQL
Server? And why does connection using integrated security fail when I
can use it in MS SQL Server Configuration Management (pipes are
disabled on my installation of SQL Server, so integrated security must
work fine over the local TCP/IP stack). I have, in fact, enabled my
installation of SQL Server 2005 to use either, and, in all my other
application projects, I can use either form of authentication without
a problem. In my other applications, in fact, I create an application
specific configuration file to govern how the application connects;
something the MIS of the client can edit as he wishes.

Can anyone shed light on why I encountered problems here and how the
errors I saw are related to the changes I made? I am not confortable
with a situation in which a change I made appears to fix something
when I do not understand WHY!

Thanks

Ted

Feb 5 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Semaj | last post by:
Environment: DB2 8.1.4; Windows 2000 We are evaluating the feasibility of upgrading our production DB from 7.2 to 8.1. During this process we've encountered an error when starting our...
10
by: Brian Conway | last post by:
I have no idea what is going on. I have a Login screen where someone types in their login information and this populates a datagrid based off of the login. Works great in debug and test through...
12
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed...
2
by: David Hearn | last post by:
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Description: An unhandled exception occurred during the execution of the current...
6
by: Chris Love | last post by:
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...
0
by: mbenedict | last post by:
I am rather new at this code and am attempting to modify existing code to use clob datatypes, which I have never used before. The database tables have been set up for clob data. When trying to use...
5
by: Cirene | last post by:
I just deployed my new ASP.NET (3.5 FW) site to the hosting company I'm using, webhost4life. NOTE: I HAVE deployed other SQL Server sites to the same account with no issues. Now I'm getting...
2
by: TG | last post by:
Hi! Once again I have hit a brick wall here. I have a combobox in which the user types the server name and then clicks on button 'CONNECT' to populate the next combobox which contains all the...
13
by: AAaron123 | last post by:
I downloaded the personal website starter kit and when I run it I get the error shown below. I found a way of using Launch Surface Area Configuration that is supposed to fix the remote setting...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.