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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:28:13+00:00 2026-05-26T09:28:13+00:00

I am not planning to use EF Code First in an MVC Website. I

  • 0

I am not planning to use EF Code First in an MVC Website. I am looking to Utilize it in a App that has a WPF Client.

Projects are setup as

  • ContactManager.Core // Contains all
    Entities(dll)
  • ContactManager.Data // Contains
    the DataContext and other data
    related Services(dll)
  • ContactManager.Services // Business
    components (dll)
  • ContactManager.Client // WPF
    Application

I am unable to generate a SQLExpress or SQLCE 4.0 DB. I am more interested in compact version db. I am not getting any error except my unit tests fail because it tries to connect a db that doesnt exist.

  • 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-26T09:28:13+00:00Added an answer on May 26, 2026 at 9:28 am

    I found out the answer 2 Options:

    Option 1:

    In your DbContext you specify the connection strings in the base constructor:

    public class RecetteContext : DbContext
    {
        public RecetteContext()
            :base("<YourConnectionString HERE>")
        {
        }
    
        public DbSet<Categorie> Categories { get; set; }
        public DbSet<Recette> Recettes { get; set; }
    
        }
    }
    

    Option 2:

    The one I used, you give you connection string a name in the DbContext base constructor:

    public RecetteContext()
        : base("RecettesDatabase")
    {            }
    

    And in your App.Config file you add a ConnectionString with the same name:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <connectionStrings>
        <add name="RecettesDatabase"
             connectionString="Data Source=RecettesDB.sdf"
             providerName="System.Data.SqlServerCe.4.0"/>
      </connectionStrings>
    </configuration>
    

    Hope it solved your issue!

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

Sidebar

Related Questions

I am planning to use jquery in Rails instead of prototype. I am not
Iam planning to create an app, and not to publish it at the google
I am looking for a trie implementation for .net. I am planning to use
I am planning to use this schema in my application, but I was not
We are looking at reworking a java business management web service that has been
I am planning to use jQuery Autocomplete (Not UI Autocomplete) plugin to fetch data
Let me first describe the way I am planning to use activemq for my
I'm starting to writing big ASP.NET MVC application and i planning to use EF
I've read the whole Dragon Book recently (just for fun, I'm not really planning
I do not know javascript right now but I am planning on learning it.

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.