Solved

How can I change the default database connection for membership?

Posted on 2008-10-12
3
262 Views
Last Modified: 2013-11-07
I have set up a website with membership login which works fine locally, though when hosted, the database has changed location and name. How can I change settings so the login control and the create user control will reference this new database configuration instead of looking for old database. The database itself is exactly the same; it has been created from the .BAK file from old DB.

Cheers.
0
Comment
Question by:finnatic
3 Comments
 
LVL 11

Expert Comment

by:anuragal
ID: 22700384
In the web.config of your website search for the tag like

<connectionStrings>
  <add name="ADConnectionString"
   connectionString="server=MyServer,database=mydatabase,integrated security=true;" />
</connectionStrings>

In this change the name of server only as you said that database name & other settings are same. Then try

Anurag
0
 

Author Comment

by:finnatic
ID: 22700487
Not quite what I need I think... The connection string you show there is not used by the login or create user controls. These controls set their own connections to a database that they create. I have other controls that access the same database via the connection string in the web.config. This I have updated and the controls connect fine, but the login still creates error as below

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)

I think it must be because the control is still looking for the original database. I need to change the provider within configuration manager??

The connection string that currently works in web.config is as below;

Server=mssql001.web24.net.au;Database=MWFDB;Uid=finnatic;Pwd=scout7;

so I need the login control and create new user control to reference this database connection.

Ideas??
0
 
LVL 26

Accepted Solution

by:
Anurag Thakur earned 500 total points
ID: 22700742
0

Featured Post

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

Join & Write a Comment

Suggested Solutions

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

757 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

20 Experts available now in Live!

Get 1:1 Help Now