Click here to Skip to main content
15,893,486 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
Hi All,

How can I retrive all the records present in a view or table to a dataset using Entity Framework.

Please respond.
Thanks in advance.
Posted

1 solution

You need to pick up a book on Entity Framework.

You don't get EF to give you a DataTable. It also doesn't work with a database view without hacking it together.

EF returns data in a DbSet attached to your DbContext. You Don't get to specify a custom query and have it returned to you any way you want.

If You want the data in a datatable, you'll have write the code to build the datatable yourself and populate it from the data returned by the DbSet.
 
Share this answer
 
v2
Comments
Pravin2989 27-Jul-13 5:58am    
Thanks for the reply. I guess i should go for the using DbSet object for navigating my data to further level.
Thanks Again

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900