Re: ERROR: Provider Management - Could not establish a connection to t



On Jan 30, 5:01 pm, Jason Vermillion
<JasonVermill...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Ted,

If you dont see entries for <connectionStrings> and <membership> settings 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\CONFIG\

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|aspnetdb.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

.



Relevant Pages

  • Re: Disabling ASP.net 2.0 Membership
    ... I checked out the article you referenced and implemented my own provider. ... as a FoxPro database, an Oracle database, or other data sources. ... custom connection string so that I can use the Commerce Server SQL Server ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Need Help: Operating system error 3706
    ... Installing an additional component resolved the problem and the software is now able to connect to the database ... The developer is currently doing a complete rewrite/update of the program, including database functions. ... While this would require a modest re-write, it's not that tough to convert to a managed-code provider instead of the COM-based OLE DB provider. ... If the application is not based on .NET, then make sure the application is upgraded to use the SNAC (SQL Server Native Client) provider which is less trouble-prone than the older MDAC-based providers. ...
    (microsoft.public.sqlserver.connect)
  • RE: Enterprise Library and PostgreSQL (Npgsql)
    ... the npgsql managed provider for postgreSQL database ... application is also developing under .net framework 1.1 and the enterprise ... Based on my understanding, the exception handling ...
    (microsoft.public.dotnet.framework)
  • Re: Replacing VS .NETs SQL Server Express Edition Integration
    ... You could write a custom membership provider. ... You could add the tables you need to your existing database table. ... As for configuring ASP.NET 2.0 membership to connect SQL Server 2000, ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Access Databases and ASP.NET 2.0
    ... but I can say that Sql Server Express is free ... and can handle much more traffic than any access database can. ... As for the default provider, its set in the base directory of IIS or in your ... I cannot set up a new website to use an Access Database to hold the site ...
    (microsoft.public.vsnet.general)

Loading