Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 595
  • Last Modified:

ASP.NET Membership - ASPNETDB.MDF not working

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
JT_SIRO
Asked:
JT_SIRO
  • 3
  • 2
  • 2
  • +1
3 Solutions
 
StephanLead Software EngineerCommented:
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
 
Alpha AuCommented:
Do you have SQL Server Express installed in your production server?
0
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
Carl TawnSystems and Integration DeveloperCommented:
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
 
JT_SIROAuthor Commented:
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
 
JT_SIROAuthor Commented:
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
 
Carl TawnSystems and Integration DeveloperCommented:
You can still attach the MDF instead if you prefer, but you still need a SQL Server available.
0
 
Alpha AuCommented:
Yes, you need a SQL Server (any version) in production environment.  the MDF doesn't like Access, it cannot run alone.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now