我有快速查找這個代碼。它做工精良的SQLCE幫助用C#+的Oracle 11g
SqlCeCommand Cmd;
Cmd.CommandType = CommandType.TableDirect;
Cmd.CommandText = "MEN";
Cmd.IndexName = "A";
Cmd.SetRange(DbRangeOptions.Match, new object[] { R[15].ToString().Trim(), MyDate }, null);
SqlCeDataReader read = Cmd.ExecuteReader();
while (read.Read())
{
TmpBAR = read[0].ToString();
}
read.Dispose();
if (TmpBAR == "")
{
//return false;
}
我嘗試轉換到Oracle這樣的:
OracleCommand Cmd;
Cmd.CommandType = CommandType.TableDirect;
Cmd.CommandText = "MEN";
Cmd.IndexName = "A";
Cmd.SetRange(DbRangeOptions.Match, new object[] { R[15].ToString().Trim(), MyDate }, null);
OracleDataReader read = Cmd.ExecuteReader();
while (read.Read())
{
TmpBAR = read[0].ToString();
}
read.Dispose();
if (TmpBAR == "")
{
//return false;
}
,我得到錯誤:
System.Data.OracleClient.OracleCommand' does not contain a definition for 'IndexName' and no extension method 'IndexName' accepting a first argument of type 'System.Data.OracleClient.OracleCommand' could be found (are you missing a using directive or an assembly reference?)
與此錯誤:
System.Data.OracleClient.OracleCommand' does not contain a definition for 'SetRange' and no extension method 'SetRange' accepting a first argument of type 'System.Data.OracleClient.OracleCommand' could be found (are you missing a using directive or an assembly reference?)