【问题标题】:Windows CE and OracleWindows CE 和甲骨文
【发布时间】:2013-04-19 08:34:23
【问题描述】:

我正在使用 VS2005,并且我有一个项目要为 Windows CE 5 构建一个应用程序,该应用程序与 Oracle 数据库 (11g) 建立连接。 这是我的代码:

        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();
            ...

这是我的参考资料:

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

但是我有一些编译错误,我不明白为什么:

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'.
...

你知道我该如何解决这个问题吗?

【问题讨论】:

  • Oracle.DataAccess.dll 是 Compact Framework 程序集还是桌面程序集?
  • 我不确定,但我猜它是一个桌面程序集。我尝试查找 Windows CE 的 oracle 参考,但找不到。有这种事吗?

标签: oracle windows-ce .net-assembly system.data


【解决方案1】:

这行不通。您不能将桌面程序集与 Compact Framework 一起使用。 Oracle 不提供 CF 连接器,因此我知道的唯一选择是在设备上使用 use Oracle Lite,然后将本地数据库同步到企业数据库,或者使用商业 3rd-party 解决方案,如 @987654322 @。

【讨论】:

  • 感谢您的帮助,我会尝试 DevArt 的 dotConnect !
猜你喜欢
  • 1970-01-01
  • 2020-06-10
  • 1970-01-01
  • 2012-07-03
  • 2011-05-13
  • 2016-04-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多