Hi! I found the solution after I got the correct inner Exception: "There is already an open DataReader associated with this Connection which must be closed first"
I had to add .toList() after each query. --> This forces entityframework to load the list into memory, and so after one query the datareader is closed. Then the next query is performed.
Correct Code:
var idProject = (from x in ebi.project
where x.Projectname.Equals(project_name) && x.Projectversion.Equals(project_version)
select x.idProject).ToList();
foreach (var id in idProject)
{
var file =(from x in ebi.documents
where x.idProject.Equals(id) && x.Folder.Equals("Codec")
select x).ToList();
...............
;