Solved

How can I change the default database connection for membership?

Posted on 2008-10-12
3
269 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:Anurag Agarwal
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
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.…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

821 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