why can not I open oracle connection in my PDA

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
frfecn
Posts: 7
Joined: Thu 23 Jul 2009 12:38

why can not I open oracle connection in my PDA

Post by frfecn » Fri 24 Jul 2009 15:07

I compiled the samples project in VS 2008,and then i did a test in my PDA.
I copied the DataReader.8.exe and devart.data.oracle.dll to my device.But when I try to connect oracle, I got a error.The exception is "PlatformNotSupportedException".
I already installed .net CF3.5 in my device,and the OS is WM6.1

at System.Text.Encoding.GetDataItem()
at System.Text.CodePageEncoding..ctor(Int32 codepage)
at System.Text.Encoding.GetEncoding(Int32 codepage)
at Devart.Data.Oracle.an.o()
at xc.t.a()
at Devart.Data.Oracle.an.ai(String A_0, Int32 A_1, String A_2)
at Devart.Data.Oracle.n.aa(OracleConnectionOptions A_0, y A_1)
at Devart.Data.Oracle.ao..ctor(OracleConnectionOptions A_0, ao A_1)
at Devart.Data.Oracle.ad.b(DbConnectionOptions A_0, Object A_1, DbConnectionBase A_2)
at Devart.Common.DbConnectionFactory.g(DbConnectionPool A_0, DbConnectionOptions A_1)
at Devart.Common.DbConnectionPoolGroup.i(DbConnectionPool A_0)
at Devart.Common.DbConnectionPool.b()
at Devart.Common.DbConnectionPool.GetObject()
at Devart.Common.DbConnectionFactory.k(DbConnectionBase A_0)
at Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
at Devart.Common.DbConnectionBase.Open()
at Devart.Data.Oracle.OracleConnection.Open()
at Devart.Data.Oracle.ConnectForm.btConnect_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.ButtonBase.WnProc(WM wm, Int32 wParam, Int32 lParam)
at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
at Microsoft.AGL.Forms.EVL.EnterModalDialog(IntPtr hwnModal)
at System.Windows.Forms.Form.ShowDialog()
at DataReader.MainForm.miConnect_Click(Object sender, EventArgs e)
at DataReader.MainForm.MainForm_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form._SetVisibleNotify(Boolean fVis)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Application.Run(Form fm)
at DataReader.MainForm.Main()

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

Post by Shalex » Wed 29 Jul 2009 15:34

Please specify your database encoding (NLS_CHARACTERSET), connection string, and the piece of code that reproduces this problem.

Internally GetEncoding asks the underlying OS to provide the specified codepage information. Obviously the OS must know this codepage. Maybe, you are using non-localized device which lacks support of that specific codepage.

frfecn
Posts: 7
Joined: Thu 23 Jul 2009 12:38

Post by frfecn » Thu 30 Jul 2009 08:37

Yes,I am using non-localized device. My device's OS is WM6.1(Chinese Version).
My computer's OS is Windows XP SP3(English), but I already changed the setting to Chinese(PRC) in Regional and Language Options.
My Oracle version is 10.2.0.3, and nls_language is SIMPLIFIED CHINESE.
I just compiled the sample project in VS2008 and try to connect my oracle database, I did not modify any source code.

SQL> show parameter nls

NAME TYPE VALUE
------------------------------------ ---------------------- --------------------
----------
nls_calendar string
nls_comp string
nls_currency string
nls_date_format string
nls_date_language string
nls_dual_currency string
nls_iso_currency string
nls_language string SIMPLIFIED CHINESE
nls_length_semantics string CHAR
nls_nchar_conv_excp string FALSE
nls_numeric_characters string

NAME TYPE VALUE
------------------------------------ ---------------------- --------------------
----------
nls_sort string
nls_territory string CHINA
nls_time_format string
nls_time_tz_format string
nls_timestamp_format string
nls_timestamp_tz_format string

SQL> exit
从 Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options 断开

C:\>chcp
Active code page: 936

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

Post by Shalex » Thu 30 Jul 2009 15:02

Could you please execute the following code on your mobile device and tell us the values of the сodePage and encodingName variables?

Code: Select all

int codePage = Encoding.Default.CodePage;
string encodingName = Encoding.GetEncoding(codePage).ToString();

frfecn
Posts: 7
Joined: Thu 23 Jul 2009 12:38

Post by frfecn » Fri 31 Jul 2009 00:55

int codePage = Encoding.Default.CodePage; //codePage = 936
string encodingName = Encoding.GetEncoding(codePage).ToString(); //encodingName = System.Text.CodePageEncoding

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Tue 04 Aug 2009 13:51

Thank you for the information, we have fixed the error.
As a temporary workaround, try setting the Unicode connection string property to true.

frfecn
Posts: 7
Joined: Thu 23 Jul 2009 12:38

Post by frfecn » Wed 05 Aug 2009 14:38

Could you tell me when will the fixed verision release?

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 06 Aug 2009 12:43

The fixed build is available.

frfecn
Posts: 7
Joined: Thu 23 Jul 2009 12:38

Post by frfecn » Fri 07 Aug 2009 13:26

I installed the newest version (5.25.39).
But I still got the same error when I change the regional to Chinese (PRC).
If I set the regional to English (United States), it can open the database, but it can not display Chinese character properly.
I tested the connection in many servers. It seems that the servers' OS version (Chinese or English) is not important. The program can connect Chinese XP/2003 and English XP/2003 if I set the device's regional to English (United States). But if I set the regional to Chinese (PRC), it will throw a "PlatformNotSupportedException" exception.

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

Post by Shalex » Mon 10 Aug 2009 16:58

Please make sure you have set the Unicode=true; parameter in your connection string.

frfecn
Posts: 7
Joined: Thu 23 Jul 2009 12:38

Post by frfecn » Tue 11 Aug 2009 01:06

I am SORRY! It is my mistake.
I set the Unicode property to true in the control "OracleConnection" before. In fact, I should be set this property in the code. It is OK now!
Thank you very much!

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

Post Reply