Вопрос

I am using VS2005 and I have a project to build an application for Windows CE 5 which make a connection to an Oracle Database (11g). Here is my code :

        OracleConnection oConnexion = null;
        OracleCommand cmd = null;
        List<ApplicationEntity> ret = null;

        try {
            oConnexion = new OracleConnection();
            oConnexion.ConnectionString = oraConnection;

            oConnexion.Open();

            String sQuery = "SELECT ...";

            cmd = new OracleCommand(sQuery, oConnexion);
            cmd.CommandType = CommandType.Text;

            cmd.Parameters.Add(new OracleParameter(":1", OracleDbType.Varchar2));
            cmd.Parameters[":1"].Value = user.Badge;

            OracleDataReader dr = cmd.ExecuteReader();
            ...

And here are my references :

C:\Oracle\Ora11g_32\Client11g\odp.net\bin\2.x\Oracle.DataAccess.dll
C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v2.0\WindowsCE\System.Data.dll

But I have some compilation errors and I don't understand why :

The type 'System.Data.Common.DbConnection' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. 
The type 'System.Data.CommandType' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
...

Have you an idea of how I could solve this issue ?

Это было полезно?

Решение

This won't work. You cannot use desktop assemblies with the Compact Framework. Oracle doesn't provide a CF connector, so the only options I'm aware of to are to use Oracle Lite on the device and then synchronize the local database to the enterprise database, or to use a commercial 3rd-party solution like DevArt's dotConnect.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top