When I'm going to make a INSERT
:
INSERT INTO categoria (cat_descricao,cat_status) VALUES ('não' ,'1' )
by passing some element with accentuation the following error occurs
ERROR: 22021: invalid byte sequence for encoding "UTF8": 0xe3 0x6f 0x27 >
But if I do the SQL
statement on the SGBD
itself, it goes normal with no problem, but when I return that information through DataTable
it also appears with changed values. I'm using PostGres
and C#
public int ExecutarSQL(string sSQL)
{
int iLinhas = 0;
if (ConectaBanco())
{
_comando.CommandText = sSQL;
iLinhas = _comando.ExecuteNonQuery();
DesconectaBanco();
}
return iLinhas;
}
When performing this function the error occurs in ExecuteNonQuery
, apparently appears to be a UTF error, but the bank then accepts the problem is in the language? what action can be taken to resolve this problem?