We use Entity Framework 5, but have a requirement to ALSO use a normal database connection from the application for some custom SQL we need to perform.
So, I am creating
I had this problem too, to solve the problem you can do this:
SqlConnection con = context.Database.Connection as SqlConnection;
SqlCommand command = new SqlCommand(sql, con);
con.Open();
SqlDataReader reader = command.ExecuteReader();
while (reader.HasRows)
{
while (reader.Read())
{
//read your fields
}
reader.NextResult();
}
con.Close();