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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:33:07+00:00 2026-05-25T00:33:07+00:00

I thought I’d try the new DbContext way of doing things in EF 4.1,

  • 0

I thought I’d try the new DbContext way of doing things in EF 4.1, but ran into a problem.

I generate a new entity data model from database (SQL Server 2008) and then I use the DbContext generator.

When I try to fetch the table called Länder i get an exception.

var db = new MyEntities();  // instantiate DbContext subclass
var countries = db.Länder.ToList();  // boom

EntitySqlException: The simple identifier ‘Länder’ must contain basic Latin characters only. To use UNICODE characters, use an escaped identifier.

If if try other tables with latin names – all is fine. And I don’t have this problem when using ObjectContext.

How am I supposed to escape the table name?

  • 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-25T00:33:08+00:00Added an answer on May 25, 2026 at 12:33 am

    We (the EF team) investigated and found that we were not properly escaping (i.e. adding square brackets) for the names of the entity sets when we bootstrap the DbSets.

    Thanks a lot for reporting this!

    We are currently testing a fix that should be included in a future release. In the meanwhile, you should be able to workaround this by specifying the entity set name explicitly such that it doesn’t contain any characters that would need escaping.

    When using Database First or Model First this can be done by editing the entity set names in the designer. When using Code First, it can be done by changing the name of the DbSet property:

        public DbSet<Länder> Lander { get; set; }
    

    or by overriding OnModelCreating in the context:

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Länder>().HasEntitySetName("Lander");
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I thought I was getting the hang of this, then I ran into a
Thought Id ask here before jumping into a problem on the Blackberry Playbook (Adobe
I thought MVC3 can bind JSON data to model by default. but this code
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I thought it would be quite easy, but found no solution for my problem:
I thought scope chain would make the first test = new test(); work, but
I thought I had resolved this but I obviously haven't and was hoping someone
I thought the following script will create div element but I got nothing output
I thought this would be fairly simple but it turns out not to work
I thought I'd find more about this topic but I didn't. I have to

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.