2

当我尝试完成对 Oracle RAW 类型的查询时,从我的 Oracle 10g 数据库获取值时遇到问题。myrawhash 最初是一个字符串。也许我没有正确转换它。

cmd = new OracleCommand();
cmd.CommandText = "SELECT * FROM mytable where HASH = :myrawhash";
cmd.Connection = oconn;

OracleParameter p_md5hash = new OracleParameter(":myrawhash", OracleType.Raw, 32);
// I suspect the line below is incorrect:                            
p_md5hash.Value = System.Text.Encoding.ASCII.GetBytes(myrawhash);  
cmd.Parameters.Add(p_md5hash);
OracleDataReader dr = cmd.ExecuteReader();
dr.Read();

错误我从异常中得到:
** 行或列不存在数据。

我知道这存在于数据库中。想法?

4

0 回答 0