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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:23:45+00:00 2026-06-08T01:23:45+00:00

I am currently using entity framework (.net 4) to read from a 3rd party

  • 0

I am currently using entity framework (.net 4) to read from a 3rd party database using LINQ statements. Unfortunately, at compile time i do not know from which table i will be reading – in fact, new tables can be added to this database after my application is compiled. The table name to read from will be passed as a string parameter to my method.

How should one approach this situation when the table name is not know at compile time? i cannot even add these tables to my data model since they might not yet exist. whilst i like the convenience of linq, i am after a simple approach.

thanks!

  • 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-08T01:23:46+00:00Added an answer on June 8, 2026 at 1:23 am

    For the queries that can only be constructed at run-time and that will return types of different shapes, you’re pretty much forced to craft and execute the SQL you want to run yourself. DataContext.ExecuteQuery(string query, params object[] parameters) is going to be your friend.

    You probably would already do this, but I would recommend keeping this portion of code isolated to one section of the code, where you execute the query, and then put the results into an strongly typed object before exposing it to other area’s of your application. Make sure you clean the table name too.

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

Sidebar

Related Questions

currently i create dynamic database using CreateDatabase() method in Entity Framework. it executes sucessfully
Im currently looking at migrating from fluent nHibernate to ADO.Net Entity Framework 4. I
TLDR; How do I read data from a table using Entity Framework, when the
I am using Entity Framework from .NET 3.5 I have two tables with 0-1
I am currently using the Self Tracking entities of the .NET Entity Framework, however
I am currently using ASP.NET MVC and Entity Framework Code First using the repository
I am using ASP.NET and the Entity Framework to make a website. I currently
I am currently programming a ASP.NET MVC3 application, using Entity Framework 4. There are
I'm currently developing an app using ASP.NET MVC3 and Entity Framework 4.1 Code First
I am currently using Entity Framework in an ASP.NET MVC 3 project. And I

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.