I use dotConnect for Oracle Mobile v. 7.2.104.2 trial, Visual Studio 2008, Pocket PC 2003 SE emulator, .NET Compact Framework 3.5
When I read data from Oracle, russian letters appear as upside down question marks ("¿¿¿¿").
Then I set Unicode = true, russian letters begin to show as 'Ð' and other wrong letters:
Code: Select all
// 017.000.00439,СкÐ,4,
// 017.000.00502,Sklad,5,
// 017.000.00505,SkлÐ,2,
https://docs.google.com/open?id=0B3wtMQ ... kRBYXNRQ00
I also included a SQL script that creates a sample database.
Here are the sample methods:
Code: Select all
private void connectOracle()
{
OracleConnectionStringBuilder oraCSB = new OracleConnectionStringBuilder();
oraCSB.Server = "172.19.1.70";
oraCSB.Sid = "DEV";
oraCSB.Port = 1541;
oraCSB.UserId = "ADMIN";
oraCSB.Password = "ADMIN";
oraCSB.MaxPoolSize = 150;
oraCSB.ConnectionTimeout = 30;
oraCSB.Unicode = true;
OracleConnection myConnection = new OracleConnection(oraCSB.ConnectionString);
myConnection.Open();
MessageBox.Show(myConnection.ServerVersion);
testOracle1(myConnection);
myConnection.Close();
}
private void testOracle1(OracleConnection connection)
{
OracleCommand command = connection.CreateCommand();
command.CommandText = "select * from XX_DEVART_TEST";
using (OracleDataReader reader = command.ExecuteReader())
{
UnicodeEncoding unicode = new UnicodeEncoding();
// printing the column names
for (int i = 0; i < reader.FieldCount; i++)
Console.Write(reader.GetName(i).ToString() + "\t");
Console.Write(Environment.NewLine);
// Always call Read before accesing data
string res = "";
while (reader.Read())
{
// printing the table content
for (int i = 0; i < reader.FieldCount; i++)
{
object val = reader.GetValue(i);
Console.Write(val.ToString() + "\t");
res += val.ToString() + ",";
// long length = reader.GetBytes(i, 0, null, 0, 0);
// byte[] rawBytes = new byte[length];
// reader.GetBytes(i, 0, rawBytes, 0, (int)length);
// byte[] bytes = unicode.GetBytes(val.ToString());
}
Console.Write(Environment.NewLine);
res += Environment.NewLine;
}
// res is:
// 017.000.00439,СкÐ,4,
// 017.000.00502,Sklad,5,
// 017.000.00505,SkлÐ,2,
MessageBox.Show(res);
// But should be:
// 017.000.00439,Склад,4,
// 017.000.00502,Sklad,5,
// 017.000.00505,Skлад,2,
}
}
Thanks in advance.