If you set Unicode
to true
on the connection does that correct it?
i.e.
cnn.Unicode = true;
As the first line inside your using statement.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi, I'm having an issue when I'm trying to recover data from Oracle into a DataTable.
Some files in Oracle, contains characters like ñ but in the DataTable results, that character turns in this: "?"
I'm using this code:
static string cnnString = @"Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=XXXXX)(PORT=XXXXX))(CONNECT_DATA=(SID=XXXXX)));User Id=XXXXX;Password=XXXXX;";
DataTable dtResult = new DataTable();
using (OracleConnection cnn = new OracleConnection(cnnString))
{
OracleCommand cmd = new OracleCommand(@" SELECT * FROM TABLA ", cnn);
cmd.CommandType = CommandType.Text;
OracleDataAdapter da = new OracleDataAdapter(cmd);
cnn.Open();
da.Fill(dtResult);
cnn.Close();
}
dtResults bring me the data without ñ characters. Someone could help me to fix it?
Thanks in advance!
If you set Unicode
to true
on the connection does that correct it?
i.e.
cnn.Unicode = true;
As the first line inside your using statement.