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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:59:17+00:00 2026-05-27T09:59:17+00:00

What is the best pattern to follow using newer EF/Linq to generate dynamic queries

  • 0

What is the best pattern to follow using newer EF/Linq to generate dynamic queries and return a generic data set?

My existing environment relies heavily on older ADO.net dynamically created SQL queries returned as Datasets. Using the pattern of:
— sql and parameter details omitted on purpose —

SqlCommand cmd = new SqlCommand();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);

This allows us to return custom queries and return them generically to the user as a grid of data. We can execute any dynamically created SQL and get back different sets of data with different columns, data types, etc.

We are NOT using this for O/R mapping, but for read only queries.

Will it be appropriate to migrate to EF/Linq for this, or would it be best to continue using ADO.net even though it seems like the old technology?

  • 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-27T09:59:18+00:00Added an answer on May 27, 2026 at 9:59 am

    Does it have to be EF/LINQ?

    How about using something like Rob Conery’s Massive for your read-only queries?
    What it does in a nutshell: it executes SQL queries and returns lists of dynamic objects.

    Quote from the link:

    var result = tbl.Query("SELECT * FROM Categories");

    […]

    What you get back is IEnumerable < ExpandoObject > – meaning that it’s malleable and exciting. It will take the shape of whatever you return in your query, and it will have properties and so on.

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

Sidebar

Related Questions

Whats the best design pattern to use for LINQ and type tables that exist
Could you tell me which is the best MVVM pattern someone have to follow
Using Backbone.js what is the best pattern to have models listen to all of
Are there any known design principles, best-practices and design patterns that one can follow
What is the best pattern for instrumentation. I have an application and i want
What is the best pattern for having a select all or deselect all checkboxes.
Is Model-View-ViewModel the best pattern to use in WPF? Are there any downsides?
What is the best method [pattern] to close a newly opened Windows form in
I am having a very hard time finding a standard pattern / best practice
If i have a complex object, what is the best practice pattern to write

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.