Solved

ASP.NET Membership - ASPNETDB.MDF not working

Posted on 2010-08-17
8
570 Views
Last Modified: 2013-11-08
I'm trying to use the default membership provider for my .NET app.  I don't have many users, so I thought I'd just go with the ASPNETDB.MDF.  

It works great in development, but I this error on my production server.
"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"

Any ideas why?  My web.config has no reference to LocalSqlServer at all.  Do I need it to?  I thought that if I put nothing at all, it will default to in and look in App_Data/ASPNETDB.MDF.  Am in wrong in that assumption?

Thanks,

justin

0
Comment
Question by:JT_SIRO
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 16

Accepted Solution

by:
Stephan earned 84 total points
ID: 33461696
Did you put the aspnetdb.mdf elsewere than where the application is? have you changed the web.config when it was set to producten?
0
 
LVL 7

Assisted Solution

by:Alpha Au
Alpha Au earned 83 total points
ID: 33462389
Do you have SQL Server Express installed in your production server?
0
 
LVL 7

Expert Comment

by:Alpha Au
ID: 33462404
0
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 
LVL 52

Assisted Solution

by:Carl Tawn
Carl Tawn earned 83 total points
ID: 33462823
LocalSqlServer comes from machine.config, which is why you don't see it in your web.config.

You will need to specify your own connection string for the membership provider and add a <clear /> tag at the start of the <connectionStrings /> section in order to remove the LocalSqlServer entry.
0
 

Author Comment

by:JT_SIRO
ID: 33466568
Doesn't it default to ASPNETDB.MDF if there is no LocalSqlServer defined in Web.config?  It seems to be doing that on my development machine, but not on the production server.

What do I put for my connectionstring, initial catalog, user ID and Password?  I don't know how to get this, as I didn't create the MDF.

<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString=";Initial Catalog=;User Id=;Password=;"/>
0
 

Author Comment

by:JT_SIRO
ID: 33467566
Oh, I just saw Alphaau's article.  It sounds like I have to use an actual SQL Server database on my production server, instead of the MDF.  Is that the case?  I thought I could use the MDF or a SQL server.  hmmm.

I've got SQL Server hosting my apps transactional data, so I'll just create the membership tables there then.
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 33467581
You can still attach the MDF instead if you prefer, but you still need a SQL Server available.
0
 
LVL 7

Expert Comment

by:Alpha Au
ID: 33471251
Yes, you need a SQL Server (any version) in production environment.  the MDF doesn't like Access, it cannot run alone.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question