score:44
Accepted answer
you will need to add reference to system.data.linq
system.data.linq is linq-sql specific (datacontext, etc)
using system;
using system.collections.generic;
using system.data.entity;
using system.data.linq;
using system.linq;
public static class queryclass
{
public static void query()
{
using (var context = new mydbentities())
{
iqueryable<mytable> qtable= from t in context.tables
select t; // can you confirm if your context has tables or mytables?
console.writeline("table names:");
foreach (var t in qtable)
{
console.writeline(t.name);//put the relevant property instead of name
}
}
}
}
Source: stackoverflow.com
Related Query
- Could not find an implementation of the query pattern for source type 'System.Data.Entity.DbSet'
- Could not find an implementation of the query pattern for source type
- Could not find an implementation of the query pattern for source type 'System.Data.Entity.DbSet` 'Where' not found
- Could not find an implementation of the query pattern for source type 'Join'
- Avoid extra loop and could not find implementation of query pattern for source type int Select not found
- Getting "Could not find an implementation of the query pattern for source type 'ExcelQueryable<T>'. " Error
- Could not find an implementation of the query pattern
- Could not find an implementation of the query pattern Error
- LINQ query on DataTable - Could not find an implementation of the query pattern
- Could not find an implementation of the query pattern on IEnumerable<T>
- error :Could not find an implementation of query for source type datatable and join not found while trying to join two datatables
- Query LINQ - Could not find an implementation of the query pattern
- Could not find an implementation of the query 'Select' not found
- LINQ: returning 2 SELECTs in 1 IQueryable for pagination? Keeping in lines with the repository pattern and not changing the return type
- Can't find the right return type for a linq query output
- Entity Framework "Could not find an implementation of the query pattern"
- The LINQ expression could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation EF Core 3.1
- The LINQ expression could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation
- LINQ "The return types for the following stored procedures could not be detected" (NOT temp tables)
- Could not determine JSON object type for type System.Char
- What is the return type for a anonymous linq query select? What is the best way to send this data back?
- linq - how do you do a query for items in one query source that are not in another one?
- The LINQ expression could not be translated. Eiither rewrite the query in a form that can be translated
- 'IEnumerable<>' does not contain a definition for '' and no extension method '' accepting a first argument of type 'IEnumerable<>' could be found
- Determine the source DataContext for a Linq to Sql query
- Entity Framework Core 3.1.1 Where query could not be translated. Either rewrite the query in a form that can be translated,
- Query expressions over source type 'dynamic' or with a join sequence of type 'dynamic' are not allowed
- Why not reveal the type and identity of the source to the client?
- Can't find the appropriate operators for a Linq query
- Error: The type or namespace name 'ExcelPackage' could not be found
More Query from same tag
- Can I extend the operators that LINQ-to-SQL supports?
- The type arguments for method GroupJoin cannot be inferred from the usage
- Group by NOT having element in common?
- linq for a for loop inside a foreach loop
- Linq to Entities - Internal Behavior of Skip and Take
- Fluent Api Include Where Clause
- How to parse child elements of XML-object with Linq
- How can I sort a list of images by the number of matching tags?
- How I get the right Data from my Column with Linq
- LINQ Grouping Based On Complex Condition
- sql tables to xml
- Using LINQ GroupBy chains to produce a multi-level hierarchy with aggregations
- F# List.map equivalent in C#?
- arrangement name use LINQ for datatable
- check discontinuity of multiple ranges in a list
- Search all child nodes of XML node for a value and remove the grandparent node
- Reactive Extensions clean up
- Select based on child of child with condition
- Using linq to find out the nearest data with the given latitude and longitude
- how to cast object of type '<TakeIterator>[System.Data.DataView]' to type 'System.Data.DataView'.?
- Linq to SQL - MDF DB in debug folder being altered on Insert, not the attached copy?
- How to create a new list from property values when grouping items with GroupBy?
- Why C# LINQ expressions must end with Select or Group By Clause where as no such restriction in VB.Net
- Combine two different lists C#
- LINQ to Entities does not recognize the method 'System.String ToString()' method,and this method cannot be translated into a store expression
- C# - Calculate Total Statistics from Multiple Files
- Linq updating XML-document
- Linq expression for ILIst works in VB.Net but not C#?
- Entity framework - Index (zero based) must be greater than or equal to zero
- Linq group by optimization