PlatformNotSupportedException of sqlCeCommand on WM5

  • Thread starter Thread starter CWing.Yip
  • Start date Start date
C

CWing.Yip

Hi, I'm writing a Windows Mobile 5.0 application on Pocket PC that
connect to it's local database on the PPC. However, a
PlatformNotSupportedException being throwed everytime
sqlCeCommand.ExecuteReader() is run. I'm using Visual Studio 2005 for
development and I have installed .NET CF 2.0, SQL Mobile 2005 and SQL
Client 2.0 on the PPC. Do you have any idea about the error? Is there
any conflict between the versions?

Thanks for your help!

The code is as below:
Private Sub ConnectDB()
Dim rdr As Object ' .Data.SqlServerCe.SqlCeDataReader

Dim Conn As New System.Data.SqlServerCe.SqlCeConnection("Data
Source = \Program Files\Test\DB1.sdf;")
Conn.Open()

Dim cmd As New SqlCeCommand("Select * from Area", Conn)
rdr = cmd.ExecuteReader() <------ Exception throw
....
....
....
Conn.Close()
End Sub
 
Before we look into any problem can you please turn option strict on? You
can do this via the project properties or by turning it on at the top of
each code file in your project. Thanks.

Cheers
Daniel
 
Thanks Daniel,
no error is showed when after I turn on option strict, however the same
problem still exist.

The code can be run from the emulator but it throws an
PlatformNotSupportedException from the device. I'm using Dell X51 which
the OS is WM5. And I have reinstalled the .Net compact framework with
the file "NETCFv2.wm.armv4i.cab", However it has the same error.

Any other way I can check?

Thanks for help,
Wing


My code:
Private Sub ConnectDB()
Dim rdr As System.Data.SqlServerCe.SqlCeDataReader

Dim Conn As New System.Data.SqlServerCe.SqlCeConnection("Data
Source = \Program Files\PPGTest_VB\DB1.sdf;")
Conn.Open()

Dim cmd As New SqlCeCommand("Select * from Area", Conn)
rdr = cmd.ExecuteReader() <------ PlatformNotSupportedException
throw

Conn.Close()

End Sub
 
Hi, I just found that the problem is due to the langusge locale, as
I've install a software to show Tranditional Chinese. Is it possible to
develop the application that support the Chinese words?
Thanks!
Wing
 
Can you create a CultureInfo object of traditional Chinese? If not, then
your device doesn't support the language (at least as far as the CF is
concerned).

Cheers
Daniel
 
Back
Top