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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:03:16+00:00 2026-06-13T00:03:16+00:00

My application is showing this error below: Data binding directly to a store query

  • 0

My application is showing this error below:

Data binding directly to a store query (DbSet, DbQuery, DbSqlQuery) is not supported

Due to the fact that I am trying to bind my drop down control to this LINQ statement.
Check below for my code;

 using (AdventureWorksEntities dw = new AdventureWorksEntities())
        {
            ddlCon.DataSource = (from em in dw.Employees
                       select new { em.Title, em.EmployeeID }).Distinct().OrderBy(name => name);
            ;


            ddlCon.DataTextField = "Title";
            ddlCon.DataValueField = "EmployeeID";
            ddlCon.DataBind();
        }

NB: Please explain well in your answers why this error and the solution to it.

  • 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-13T00:03:19+00:00Added an answer on June 13, 2026 at 12:03 am

    Just like in your other question, you need to use ToList(), as you can’t bind directly to a query result.

    That being said, I also suspect your OrderBy is incorrect. This should likely be:

     ddlCon.DataSource = (from em in dw.Employees
                          select new { em.Title, em.EmployeeID })
                        .Distinct()
                        .OrderBy(emp => emp.Title)  // Pick Title or EmployeeID here
                        .ToList();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get this error: ArgumentError in Videos#index Showing /rubyprograms/dreamstill/app/views/layouts/application.html.erb where line #15 raised: No
when i run the my asp.net application it is showing this message can u
I'm using http://code.google.com/p/flex-iframe/ for showing html in an flex application. To set this up
A web page of a web application was showing a strange error. I regressively
I am preparing android application which is showing the following error: 03-21 17:30:41.988: E/AndroidRuntime(782):
I am writing this simple Qt application, but it is showing the following errors.
I keep getting this error when I deploy my application in the server machine
I get this error when I login: NoMethodError in Videos#index Showing /rubyprograms/dreamstill/app/views/videos/_video.html.erb where line
I get this error: NoMethodError in Videos#new Showing /rubyprograms/dreamstill/app/views/videos/new.html.erb where line #1 raised: undefined
Hi I am trying to implement a simple application showing picasa photos in android.

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.