-1
That column DocumentoPDF
until now it was not used by the:
I mean I was always null
, however at some point added values and then error occurred in my query linq
and the problem is that at the moment I am not using this attribute:
This is the error message:
"já existe um DataReader aberto associado a este command que deve ser fechado primeiro"
The error already occurs even before the execution of the query:
IEnumerable<MinhaEntidade> minhaEntidade = new IEnumerable<MinhaEntidade>()
IEnumerable<MinhaEntidade> _dados = from prg in minhaEntidade.listaDados() join servicos in _servicos on prg.IdServico equals servicos.Id into outServicos
join servicos in _servicos on prg.IdServico equals servicos.Id into outServicos
from servicos in outServicos.DefaultIfEmpty()
select new ProcessamentoRegistrosDTO
{
Id = prg.Id,
Nome = prg.Nome,
Campo1= servicos.Campo1,
Campo2= prg.Campo2
};
That is the entity:
public class MinhaEntidadeDTO
{
public int Id { get; set; }
public int IdServico {get; set;}
public string Nome { get; set; }
public string SobreNome { get; set; }
public string DocumentoPDF { get; set; }
}
Enabling MARS in his
connectionstring
It will probably work, but try to identify where you are opening the connection and running more than one command on it. I don’t understand exactly where the error is occurring by what you published.– George Wurthmann
@George Wurthmann edited the question and added an error image.
– hard123
The root cause of the problem has been identified and the problem has been solved and I will add the solution to the post.
– hard123
The problem is the
tipo
of the attribute in the application data model: typestring
and in the Sql Server databasevarbinary
, although not using this attribute in my queries the error displayed has not much to do with the fact, but I changed the model tobyte[]
and the error no longer occurs.– hard123