Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8081927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:54:10+00:00 2026-06-05T16:54:10+00:00

I have an ASP.NET MVC3 application that I have built and it has two

  • 0

I have an ASP.NET MVC3 application that I have built and it has two databases.

One is in reference to the Default Membership Provider and was automatically created when I built the app.

The other is a database I have named SchoolContext and I would like all the information within SchoolContext to be stored in the same database as all the data in Default Membership Provider.

Here are my two connection strings:

<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
<add name="SchoolContext" connectionString="Data Source=|DataDirectory|School.sdf" providerName="System.Data.SqlServerCe.4.0" />

I tried renaming ApplicationServices to SchoolContext and then commenting out my second connection string and I can load up and “log in” using the default membership provider just fine, but whenever I need to queue the database for information that was stored within the original SchoolContext, I get errors stating that the model is nonexistant, etc. . . and the data is not built within the database that contains the information from the default membership provider.

I am using an initializer to rebuild the database if the model changes:

public class SchoolInitializer : DropCreateDatabaseIfModelChanges<SchoolContext>

And this works fine any time I edit something in the model and I am using the two database scheme. However, it is not working when I want to join the two databases into one.

I apparently do not know how to connect the two databases as what I am trying to do is not working, how should I appropriately set up mvc to put my SchoolContext into the same database as the information needed for the Default Membership Provider?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T16:54:12+00:00Added an answer on June 5, 2026 at 4:54 pm

    Two potential answers:

    1. If I understand your intent you are trying to use two separate DB
      Contexts and perform queries that join across both of them. This is
      not possible in Entity Framework (as of this writing) though it may
      be considered in the future. See this post for more specifics:
      https://stackoverflow.com/a/8536400/941058

      If you need to join up information you will need to do it in memory
      using LINQ. Essentially you’ll need to store foreign key
      information in either database and reference it when querying one or
      the other.

    2. If you are not trying to cross-context join but instead just want to use the Default Membership Provider with EF consider this:
      http://efmembership.codeplex.com/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have application built on asp.net MVC3. Application runs fine but I see one
I have to develop an ASP.NET MVC3 application in C# and Razor that has
I have a ASP.NET MVC3 application that handles time-consuming processes (copying a large file
We have an ASP.Net MVC3 application that is running on Azure, connecting to a
I have an asp.net MVC3 application that makes Ajax calls to the server on
I have built an ASP.NET MVC 3 web application (with exlusively Razor/cshtml pages) that
I have an application built in ASP.NET MVC 3 that uses SQL CE for
I have develop small Asp.net MVC3 application using Telerik rad Controls with in that
I have a asp.net MVC3 Application with two users Admin and General.Cookies is saved
My application is in Asp.Net MVC3, i have two Users(Admin and general).Im maintaining the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.