0

I've created a fresh ASP.NET Web Forms model, with authentication pre built. I've then run through the following link

http://msdn.microsoft.com/en-us/data/jj206878

and created an entity framework from my exisiting database.

Ok, so far so good, however, when i fire up the project and click Register, the user created is still being inserted into a local db in the App_Data folder.

Why is this, and how can I ensure that all new users are pooled / created in my own database?

2 Answers 2

2

Probably because your DbContext is using built-in connection string. You can specify which connectionstring from your web.config to use when you initialize it in constructor like so.

public class MainDataContext : DbContext
{
    public MainDataContext() : base("Name=NameOfConnectionString") { }

    // public DbSet ...
}
Sign up to request clarification or add additional context in comments.

Comments

2

Change you Default Connection String at Web.config/App.config with credentials of your own database.

Hope following link will help you:

http://hgminerva.wordpress.com/2013/09/21/how-to-create-the-asp-net-membership-tables-in-your-own-database/

1 Comment

Bappi I followed your link but, and I can now see my connection string is pointing to my existing database, but I get the following error: The model backing the 'ApplicationDbContext' context has changed since the database was created. Consider using Code First Migrations to update the database (go.microsoft.com/fwlink/?LinkId=238269).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.