4
I am having a problem at the time of saving the data in my ORACLE database.
When using my application to fill in the fields and register a string, the special characters as accents for example are replaced by a ? in the database
The detail is that if I take the same query and do by SQL DEVELOPER it usually registers any special character.
My application is done in C#, with the pages using Razor (cshtml). The html charset is UTF-8.
I do not know how to check the bank’s charset, because I am very beginner in ORACLE.
Ideas about what might be causing this?
Code in the application:
comand.CommandText = "UPDATE TB_EBITDA SET TXT_OBSERVACAO = '" + txt_observacao + "' WHERE COD_CONFIGURACAO = " + codigo + "";
dataReader = comand.ExecuteReader();
dataReader.Read();
Code generated, picked through debug and paste in SQL Developer:
UPDATE TB_EBITDA SET TXT_OBSERVACAO = 'Observacão' WHERE COD_CONFIGURACAO = 5
Please pass the code used to enter the data into the database?
– Leonel Sanches da Silva
I don’t know if it’s very relevant, but there you are. "Observation" I wrote without the same. But it records "Observac? o"
– Joao Paulo
You are not using parameters to execute your command. The correct one would be yours
CommandText
have the parameter declaration and specify the Unicode in the parameter.– Leonel Sanches da Silva
Can you give an example?
– Joao Paulo
I’ll try to answer.
– Leonel Sanches da Silva
Wouldn’t that be a configuration of the bank itself? Because its command seems to be right. Have a look at this link(http://eltzti.wordpress.com/2011/06/13/configuracao-apex-oracle-xe-charactecterset/) and if possible make the changes.
– Matheus Bessa