Asp .Net C(sharp) + MySql
22/09/2015
0
Olá galera, beleza?
Bom, tenho um projeto Asp Net e quero a ajuda no seguinte item abaixo aonde tento trazer os número mais sorteados (10) e da erro. Pra ser bem sincero eu usava esse código no Firebird e funcionava normalmente, mas como estou me aventurando no Asp Net MySql gostaria de fazer funcionar esse código.
public DataTable getResultadosMaisSorteados_Dez()
{
Cmd.CommandText = @"with CTE_Unpivot as
(
select cl_1 as dezena from thsoftwares02.concurso_lotofacil
union all
select cl_2 from thsoftwares02.concurso_lotofacil
union all
select cl_3 from thsoftwares02.concurso_lotofacil
union all
select cl_4 from thsoftwares02.concurso_lotofacil
union all
select cl_5 from thsoftwares02.concurso_lotofacil
union all
select cl_6 from thsoftwares02.concurso_lotofacil
union all
select cl_7 from thsoftwares02.concurso_lotofacil
union all
select cl_8 from thsoftwares02.concurso_lotofacil
union all
select cl_9 from thsoftwares02.concurso_lotofacil
union all
select cl_10 from thsoftwares02.concurso_lotofacil
union all
select cl_11 from thsoftwares02.concurso_lotofacil
union all
select cl_12 from thsoftwares02.concurso_lotofacil
union all
select cl_13 from thsoftwares02.concurso_lotofacil
union all
select cl_14 from thsoftwares02.concurso_lotofacil
union all
select cl_15 from thsoftwares02.concurso_lotofacil
)
select first 10
Dezena,
COUNT(*) as Qtd
from CTE_Unpivot
group by
Dezena
order by
Qtd desc";
DataTable dt = ExecutaSelect();
return dt;
}
Bom, tenho um projeto Asp Net e quero a ajuda no seguinte item abaixo aonde tento trazer os número mais sorteados (10) e da erro. Pra ser bem sincero eu usava esse código no Firebird e funcionava normalmente, mas como estou me aventurando no Asp Net MySql gostaria de fazer funcionar esse código.
public DataTable getResultadosMaisSorteados_Dez()
{
Cmd.CommandText = @"with CTE_Unpivot as
(
select cl_1 as dezena from thsoftwares02.concurso_lotofacil
union all
select cl_2 from thsoftwares02.concurso_lotofacil
union all
select cl_3 from thsoftwares02.concurso_lotofacil
union all
select cl_4 from thsoftwares02.concurso_lotofacil
union all
select cl_5 from thsoftwares02.concurso_lotofacil
union all
select cl_6 from thsoftwares02.concurso_lotofacil
union all
select cl_7 from thsoftwares02.concurso_lotofacil
union all
select cl_8 from thsoftwares02.concurso_lotofacil
union all
select cl_9 from thsoftwares02.concurso_lotofacil
union all
select cl_10 from thsoftwares02.concurso_lotofacil
union all
select cl_11 from thsoftwares02.concurso_lotofacil
union all
select cl_12 from thsoftwares02.concurso_lotofacil
union all
select cl_13 from thsoftwares02.concurso_lotofacil
union all
select cl_14 from thsoftwares02.concurso_lotofacil
union all
select cl_15 from thsoftwares02.concurso_lotofacil
)
select first 10
Dezena,
COUNT(*) as Qtd
from CTE_Unpivot
group by
Dezena
order by
Qtd desc";
DataTable dt = ExecutaSelect();
return dt;
}
Thiago Trassi
Curtir tópico
+ 0
Responder
Posts
01/10/2015
Joel Rodrigues
Qual erro ocorre? Sempre diga qual é o erro pois simplesmente "dá erro" é complicado de dizer algo.
Responder
Clique aqui para fazer login e interagir na Comunidade :)