Solved

ASP.NET Membership - ASPNETDB.MDF not working

Posted on 2010-08-17
8
562 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:alphaau
alphaau earned 83 total points
ID: 33462389
Do you have SQL Server Express installed in your production server?
0
 
LVL 7

Expert Comment

by:alphaau
ID: 33462404
0
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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:alphaau
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

943 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now