You're giving this error. I'm using postgres
Erro ao buscar servidor por id: Timeout while getting a connection from pool.
A first chance exception of type 'System.Exception' occurred in BackupDAO.dll
Method
public Servidor buscarPorID(int id)
{
try
{
DAOFactoryNuvem dao = new DAOFactoryNuvem();
conexao = dao.CriaConexao();
String sql = "select * from servidor where id = "+id;
NpgsqlCommand sqlCon = new NpgsqlCommand(@sql, conexao);
conexao.Open();
NpgsqlDataReader drCon;
drCon = sqlCon.ExecuteReader();
while (drCon.Read())
{
Servidor servidor = new Servidor(Convert.ToInt32(drCon[0]), drCon[1].ToString(), drCon[2].ToString());
drCon.Close();
return servidor;
}
Servidor servidor1 = new Servidor(0, "", "");
conexao.Dispose();
return servidor1;
}
catch (Exception erro)
{
Console.WriteLine("Erro ao buscar servidor por id: " + erro.Message);
throw erro;
}
finally
{
conexao.Clone();
}
}