注册

获取存储过程out参数值,怎么转换成DmDataReader

Biu小鱼儿 2023/03/13 742 1

获取存储过程out参数值,怎么转换成DmDataReader

var command = conn.CreateCommand();
command.CommandText = sql;
command.CommandTimeout = 2000;
command.CommandType = System.Data.CommandType.StoredProcedure;
command.Parameters.AddRange(parameterArray);
DmParameter ret = new DmParameter(“AA”, DmDbType.Cursor);
ret.Direction = System.Data.ParameterDirection.Output;
command.ExecuteNonQuery();
// 读取输出参数的值
var outputValue = (这里怎么把值转换成DmDataReader,方便后面read)(command.Parameters[“AA”].Value);
//DmDataReader reader = outputValue.GetDataReader();
while (outputValue.Read())
{
for (int i = 0; i < outputValue.FieldCount; i++)
{
result.Add(outputValue.GetValue(i));
}

            }
回答 0
暂无回答
扫一扫
联系客服