Problem with russian/ukrainian charset

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
tsv
Posts: 13
Joined: Fri 16 Jan 2009 06:11
Location: Kiev, Ukraine
Contact:

Problem with russian/ukrainian charset

Post by tsv » Fri 16 Jan 2009 08:14

Hello.

I have a problem with russian/ukrainian charset in my program.
I use VS 2005 + C#(Compact Framework 2.0) + dotConnect for Oracle 5.00 Mobile Trial (5.0.12.1) on Windows CE 5.0 (English) + Oracle 10.2
NLS_CHARACTERSET = CL8MSWIN1251
This problem is like this http://www.devart.com/forums/viewtopic.php?t=10898
I have the same characters.

Help me please to slove it.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 16 Jan 2009 15:04

We have reproduced the issue. Something is wrong with setting the Unicode property to true inside our provider. You will be notified about the results as soon as possible.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 16 Jan 2009 16:33

Sorry for the inconvenience. The reason was in our sample code - the connection property was reinitialized in the btConnect_Click() method. dotConnect for Oracle works fine.
1. Have you set the Unicode property to true in your code?
2. What is the type of the columns from which you retrieve russian and ukrainian symbols?
3. Have you tried to add russian and ukrainian language on your Windows CE 5.0?
4. How do you retrieve data from database? Please provide us with the code sample.

We have tried to use our provider with Oracle 10.2.0.1 database that has the same charset. It works normally.

tsv
Posts: 13
Joined: Fri 16 Jan 2009 06:11
Location: Kiev, Ukraine
Contact:

Post by tsv » Mon 19 Jan 2009 06:19

Shalex wrote:Sorry for the inconvenience. The reason was in our sample code - the connection property was reinitialized in the btConnect_Click() method. dotConnect for Oracle works fine.
1. OracleConnection.ConnectionString = "user id=admin;password=admin;host=10.10.10.50;sid=TSD;Unicode=True;"
2. I retrieve values from VARCHAR2
3. No. I haven't try. The previous soft which we a using now (foreign company write it for us) is work fine. They use CoreLab.Oracle.dll (4.25.24.1). But I can try, if I find.
4. I just use your sample demo C:\Program Files\Devart\dotConnect Mobile\Oracle\Samples\DataReader

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 19 Jan 2009 10:11

Be aware, even if you set the OracleConnection.ConnectionString property in MainForm.cs of the C:\Program Files\Devart\dotConnect Mobile\Oracle\Samples\DataReader demo, it will be reinitialized by the btConnect_Click() method in ConnectForm.cs. Please try adding the following line of code before the try...catch statement in the btConnect_Click() method:

Code: Select all

connection.Unicode = true;
Please notify us about the results.

tsv
Posts: 13
Joined: Fri 16 Jan 2009 06:11
Location: Kiev, Ukraine
Contact:

Post by tsv » Mon 19 Jan 2009 10:32

I try this in Connect method:

ConnectForm connectForm = new ConnectForm(OracleConnection);
if (OracleConnection.Unicode) MessageBox.Show("1");
connectForm.ShowDialog(); //this method set Unicode to false
if (OracleConnection.Unicode) MessageBox.Show("11");


First message box is shown, but second is not. Connection close after I try to set property again ().

tsv
Posts: 13
Joined: Fri 16 Jan 2009 06:11
Location: Kiev, Ukraine
Contact:

Post by tsv » Mon 19 Jan 2009 14:03

I found the problem.

If I use dialog for connection (as I write before) it set Unicode property to false, but if I use Open method it work's fine.
Thank you for help.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 19 Jan 2009 14:17

Please read carefully my previous post. Just replace the btConnect_Click method in the ConnectForm.cs file with the following code (the difference in the "connection.Unicode = true;" line):

Code: Select all

    private void btConnect_Click(object sender, System.EventArgs e) {

      connection.Close();
      connection.ConnectionString = "";
      connection.UserId = tbUser.Text;
      connection.Password = tbPassword.Text;
      connection.Port = Convert.ToInt32(tbPort.Text);
      connection.Server = tbHost.Text;
      connection.Sid = tbDatabase.Text;
      connection.Unicode = true;

      try {
        Cursor.Current = Cursors.WaitCursor;
        connection.Open();
        Cursor.Current = Cursors.Default;
        DialogResult = DialogResult.OK;
      }
      catch {
        Cursor.Current = Cursors.Default;
        retries--;
        if (retries == 0)
          DialogResult = DialogResult.Cancel;
        throw;
      }
    }
Please notify us about the results.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 19 Jan 2009 14:18

Welcome!

tsv
Posts: 13
Joined: Fri 16 Jan 2009 06:11
Location: Kiev, Ukraine
Contact:

Post by tsv » Mon 19 Jan 2009 14:26

I have solved a problem. Thank you. :)

Post Reply