Question

On my home computer, i am working on a ASP.NET Website Project. Which is accompanied with a SQL Server 2012 database.

I'm trying to transfer this project over to my laptop. I have successfully restored the database on my laptop and fixed some connection errors on the ASP.NET website project (web.config file).

In my database i have integrated the aspnetdb to handle my users/roles/membership along with the other tables i have. Unfortunately, after the transferring the entire database over to my laptop it seems to have deleted my roles, but not my users. Therefore, causing a problem when a user tries to login to my asp.net website.

I have loaded the asp.net website management tool and as i expected it says there are 3 users and 0 roles. I was just going to recreate the roles, as my database isent that big. Strangely enough, the transfer only deleted the roles and not the users. However, upon clicking "create or manage roles" i get an error. Just want to mention same thing occurs when trying to create a new user, using this tool.

The Error:

An error was encountered. Please return to the previous page and try again.

The following message may help in diagnosing the problem: 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) at System.Web.Administration.WebAdminPage.CallWebAdminHelperMethod(Boolean isMembership, String methodName, Object[] parameters, Type[] paramTypes) at ASP.security_roles_manageallroles_aspx.BindGrid() at ASP.security_roles_manageallroles_aspx.Page_Load() at System.Web.Util.CalliHelper.ArglessFunctionCaller(IntPtr fp, Object o) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

I assume problem lies in me transferring the asp.net website project folder over to my laptop and the asp.net website administration tool cannot recognize the sql server instance, so i need to update this somehow to match the new sql server instance.

How can i fix my problem?

UPDATE:

I just checked my home machine database and interestingly enough, there is no data stored in the aspnet_roles table. But there are users stored in the aspnet_users table. Now why is it not storing the roles in that table? :/

I'm abit confused, if its not storing the roles in that table.. where would it be storing them?

Update 2

I just noticed the roles are getting stored in app_data folder into ASPNETDB and not the database i have connected on my sql server. I don't know how this has happend as it use to get added to my sql server. is there a way i can transfer my aspnetdb tables and data into my sql database?

I just did a test by creating a new user. The new user gets stored in my sql database i have. But it does not get stored in the aspnetdb, but the roles are getting stored in the aspnetdb but not the tables in my sql database.

Question: How can i combine these and only have it update data in my sql database?

Update 3

I fixed the problem with the roles and users getting stored in 2 diff providers, i just had to point them to a single provider.

Was it helpful?

Solution

How are you referencing your database? Chances are you have the name of the computer in connections string (or IP address). Check to make sure this is changed as well. THis is most likely in your web.config file. If you still have your old server setup, you can actually export all the tables and records to an sql file and then upload it to the new server.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top