why can not I open oracle connection in my PDA
why can not I open oracle connection in my PDA
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()
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()
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.
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.
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
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
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();
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.
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.
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;
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;