当我尝试在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();
错误我从这个例子中得到:
**行或列没有数据。
我知道这存在于数据库中。思考?