Click here to Skip to main content
15,936,430 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello Everyone,
I am working on one application, My application in ASP.NET MVC 5 and Database I am using MySQL.
priviusly I used Execute Raw SQL queries in entity framework with Sqlserver
For example :

using (var ctx = new SchoolDBEntities())
var Courses = ctx.Students.SqlQuery("Select * from Courses").ToList();


using (var ctx = new SchoolDBEntities())
var Courses= context.Database.SqlQuery<courses>("exec sp_StoredProcedure").ToList()


What I have tried:

Can you share me any possible scenario to implement same thing with the MySql Database.
Updated 21-May-18 2:28am
Richard Deeming 21-May-18 14:00pm    
You use exactly the same methods as you do for SQL Server. You just need to fix any syntax errors caused by the differences between MySQL and SQL Server.
Rahul Newara 22-May-18 1:30am    
Hello Richard,
Thank you vary much. Its working fine..

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