-1
I have the following method:
private static List<ProdutosTmpModel> GetInListaPromo_caddespd(Dados dados, Empresa emp)
{
//busca todas os produtos das listas vigentes
StringBuilder command1 = new StringBuilder();
command1.Append(" SELECT a.cod_filial, " +
" a.cod_reduzido," +
" a.prc_desconto," +
" b.vlr_custo," +
" b.prc_lucro, " +
" b.vlr_venda," +
" a.vlr_promocao," +
" b.cod_barra," +
" a.dat_fim" +
" FROM produto1 AS a" +
" INNER JOIN produto2 as b on a.cod_reduzido = b.cod_reduzido" +
" WHERE a.cod_filial = " + emp.filial +
" AND a.dat_fim >= NOW()" +
" ORDER BY a.dat_fim; ");
_GetInListaPromo = command1.ToString();
NpgsqlConnection conn = ConectionTrier.npgSqlConection(dados.host, "5432", dados.banco, dados.usuario, dados.senha);
conn.Open();
NpgsqlCommand cmd = new NpgsqlCommand(command1.ToString(), conn);
NpgsqlDataReader reader;
reader = cmd.ExecuteReader();
}
when I run this method on the client’s pc, where this ">" is placed " u003e" causing a sql error, however on my pc it does not happen, how can I fix it ?
in the image below it is possible to see the executed command:
your ENCODING is wrong... try to set the bank encoding to UTF8
– Rovann Linhalis
I do not have autonomy for changes in the bank, can you tell me if there would be some way to "force" the ">" ? via code
– alessandre martins
Replace images with text, otherwise anyone who tries to reproduce the problem will need to type TD.
– tvdias
what error is causing? and turning into JSON does not mean that it is going wrong.
– novic
Virgilio, gives syntax error, because when executing the character ">" is replaced by " u003e"
– alessandre martins
Dude, take a look: https://answall.com/questions/321194/como-definir-o-set-client-encoding-utf8-de-forma-permanent I hope it helps
– Victor Ferraz