Solved

ASP.NET Membership - ASPNETDB.MDF not working

Posted on 2010-08-17
8
573 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

732 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