Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to execute a simple query like "Select * from student where Id = 1" with Entity Framework's Context. But I don't have model for 'student' Table. How i can execute this sql query and read the data?
Posted
Updated 3-Apr-14 3:17am
v2
Comments
Maciej Los 3-Apr-14 14:49pm    
Why?

1 solution

hi #RAvi,

here is sample

C#
using (var context = new EntityContext())
{
    var blogs = context.Blogs.SqlQuery("Select * from student where Id = 1").ToList();
}
 
Share this answer
 
v2

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