Solved

How can I change the default database connection for membership?

Posted on 2008-10-12
3
263 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

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

Suggested Solutions

Title # Comments Views Activity
How to access a DataBinder.Eval variable using C# ? 4 27
Allow space in this pattern 2 47
Anyway to make "All" the default in the dropdown? 6 34
Error on Add method 1 37
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
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.…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

911 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

21 Experts available now in Live!

Get 1:1 Help Now