C# 调用含有OutPut参数sp的写法

public DataTable Get(string Hash_Key, out string Hash_Value)
        {
            string sql = "sp";
            Hash_Value = "";
            SqlParameter[] parms = {
                        new SqlParameter("@Hash_Key", SqlDbType.VarChar,20),
                        new SqlParameter("@Hash_Value", SqlDbType.VarChar,20)
                    };
            parms[0].Value = Hash_Key;
            parms[1].Value = Hash_Value;
            parms[1].Direction = ParameterDirection.Output;

            DataSet ds = SqlHelper.ExecuteDataset(sBASICDB, CommandType.StoredProcedure, sql, parms);

            Hash_Value = parms[1].Value.ToString();

            return ds.Tables[0];
        }

 

上一篇:ado.net 调用存储过程


下一篇:Linux-grep 命令和find 命令 (6)