我正在使用 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'.
...
你知道我该如何解决这个问题吗?