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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:21:39+00:00 2026-06-15T21:21:39+00:00

I have a linq query which fetches all records from the customer table to

  • 0

I have a linq query which fetches all records from the customer table to an observable collection as below:

customerList = new ObservableCollection<customer>(dbContext.customers);
dgRecords1.ItemsSource = customerList;

the list is bound to a datagrid.
The customer table contains many fields nearly hundred. But I display only a few fields on the datagrid. My question is

whether bringing of only selected fields from the database using linq query increase the speed the customer screen?

I need to filter and sometimes delete records from this list.

Which is the best way to select few fields into observable collection, Can someone give some sample linq queries?

  • 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-15T21:21:41+00:00Added an answer on June 15, 2026 at 9:21 pm

    Tips to optimize speed:

    • reducing columns reduces bandwidth required
    • reducing rows, but introducing paging, reduced bandwidth by much more (usually)
    • turning off change-tracking and identity-management (for example ObjectTrackingEnabled in LINQ-to-SQL) will reduce overheads post-processing the data
    • using a pre-compiled query can sometimes help reduce pre-processing overheads

    … but frankly, when we had this problem, we solved it “once and for all” by writing “dapper”, and going old-school:

    var list = connection.Query<CustomerViewModel>(
        "select {some specific cols} from Customers").ToList();
    

    where CustomerViewModel is a simple POCO type not related to LINQ etc that just has the required values, for example:

    class CustomerViewModel {
       public int Id {get;set;}
       public string Name {get;set;}
       // ...
    }
    

    This cuts out all unnecessary overheads, and is ideal when you just want to display data; additionally, the parameterization and materialization layers are very optimised (with strategy-caching, for optimum performance).

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

Sidebar

Related Questions

I have the below linq query which takes a text field which may be
I have a LINQ query which is attempting to get all of the distinct
I have a LINQ query which creates an anonymous collection. One thing I'm returning
I have LINQ Query which return result in below format -- Parent1 ----Childs ------key
I have a LINQ query which returns all the values inside a Dictionary, conditional
I have a LINQ query which has the below joins join v in dc.Vehicles
I have a linq Query which works well. var data = from c in
I have a LINQ query which results an array of Job records. Due to
I have a linq query which presents data that is present in CustomersRecord Table
I have linq query as follows: var result = (from Customer cust in db

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.