7

I tried to set-up the SQL tables for ASP .net 2.0 membership provider by clicking on ASP.net Configuration under Project.

I have completely uninstalled SQL 2005 Express and installed SQL 2008 Express instead.

It seems like that it can not connect to the database.

Does anybody know how to get this fixed so I can use 2008 instead ?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Raha
  • 1,959
  • 3
  • 19
  • 28
  • 1
    What's the exact error you get when you try to connect to the database? Are you trying to connect from the same machine, or from a remote machine? Try locally first just to make sure it's not a firewall or security issue. – Brent Ozar Apr 21 '09 at 00:54
  • Did you mean that the membership provider in SQL 2005 can be connected? Could you login SQL 2008 through Management Tool? Have you checked your web.config? Is it on your local or you're trying to host through IIS6/IIS7? – Dan An Jul 04 '12 at 09:20

5 Answers5

1

Try to configuring the database typing "aspnet_regsql" on the VS command prompt.

Then setup the database and finally change de connection string on the web.config file.

ASP.NET SQL Server Registration Tool (Aspnet_regsql.exe)

0

The connectionStringName used in the membership Tag should be changed to the present connection string where you have the membership tables created.

If the connectionStringName is not pointing to a valid connection String name in the connectionStrings tag, the membership tables can not be used by the application.

David Jiboye
  • 511
  • 8
  • 19
0

What is your SQL 2008 installation instance called? What does your connection string for the membership provider look like?

As far as I know, there is (or was) a glitch in the SQL Server 2008 Express installation that even if you chose to install as "default" instance, it would still make it a "named instance" called ".\SQLExpress" instead. Could that be the problem?

Marc

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
0

As Marc already has pointed out, it could be the problem with the instance name. This is fixed in service pack 1 for SQL Server 2008 Express. For more information and a workaround, see this Microsoft KB article.

Magnus Johansson
  • 28,010
  • 19
  • 106
  • 164
0

SQL 2005 and 2008 are both configured in a fairly locked down state by default - and this means that SQL won't accept access the database other than through Shared Memory, even with Integrated Security.

You need to enable TCP/IP or Named Pipes for the Client Protocols for the server (as this is how ASP.NET talks to SQL if you've not configured a DSN to use Shared Memory.

I can't remember the exact steps in 2k8, as I've only had to do it once, but in 2k5 you had to open the SQL Server Configuration Manager, select SQL Native Client Configuration, Client Protocols, and enable TCP/IP and Named Pipes - it's a similar process for 2k8 as I recall.

Zhaph - Ben Duguid
  • 26,785
  • 5
  • 80
  • 117