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 6950375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:05:04+00:00 2026-05-27T14:05:04+00:00

I have a dot net 4.0 DAL library project that contains three edmx files.

  • 0

I have a dot net 4.0 DAL library project that contains three edmx files. I chose to split my data model in three files because there are many tables in my db, and from what I’ve read here at Stackoverflow it seemed best practice to do so.

But now I have three connection string entries in my App.config that basically uses the same database connection. Can I somehow get back to the old ado.net style with only one connection string in my config files?

Thanks,
Jens

  • 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-05-27T14:05:05+00:00Added an answer on May 27, 2026 at 2:05 pm

    In your code you could use the EntityConnectionStringBuilder to build the three separate connection strings from a ‘regular’ connection string that’s stored in your config file.

    You would get something like:

    string providerString = <load your connection string>;
    
    // Initialize the EntityConnectionStringBuilder.
    EntityConnectionStringBuilder entityBuilder =
        new EntityConnectionStringBuilder();
    
    //Set the provider name.
    entityBuilder.Provider = providerName;
    
    // Set the provider-specific connection string.
    entityBuilder.ProviderConnectionString = providerString;
    
    // Set the Metadata location.
    entityBuilder.Metadata = @"res://*/AdventureWorksModel.csdl|
                                res://*/AdventureWorksModel.ssdl|
                                res://*/AdventureWorksModel.msl";
    

    You can create three EntityConnectionStrings and change the MetaData property on each one to point to your Model.

    But be aware that this would lead to a hardcoded part of your connection string in code.

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

Sidebar

Related Questions

I have a dll that contains a dot net assembly - common intermediate language.
I have a dot net windows service project which contains multiple services. This has
I have a dot net nuke 4 site with that has a forum. It
Does dot net 3.5 provides some api to calculate crc32 for input data?I have
how to implement calculate crc32 for data using dot net 3.5 api.I have done
I have a dot net nuke site that I have written a custom module
I have heard of remote dot net application. What I have understood that the
Technology: Dot Net, ASP.Net We have articles stored in XML repository and article contains
i have created an installer(dot net deployment project) on VS 2005 which automatically installs
We have an old project that requires occasional maintenance that uses VS2003 and Dot

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.