Solved

ASP.NET Membership - ASPNETDB.MDF not working

Posted on 2010-08-17
8
560 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

759 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

24 Experts available now in Live!

Get 1:1 Help Now