獲取儲存過程輸出引數
阿新 • • 發佈:2018-11-03
public string UpdateStockINCheck(StockStockIN model)
{
string bResult = "";
int count = 0;
try
{
// 建立引數
SqlParameter[] parameters = {
new SqlParameter("@Operator", SqlDbType.VarChar,20) ,
new SqlParameter("@BillID", SqlDbType.Int) ,
new SqlParameter("@bResult", SqlDbType.VarChar,200) ,
};
// 設定引數型別
parameters[0].Value = model.Operator;
parameters[1].Value = model.StockINID;
parameters[2].Direction = ParameterDirection.Output; // 設定為輸出引數
SqlHelper.ExNonQuery(wdgj31sqlcon, System.Data.CommandType.StoredProcedure, "G_StockINBill_Exec", parameters);
bResult = parameters[2].Value.ToString();
}
catch (Exception ex)
{
}
return bResult;
}
{
string bResult = "";
int count = 0;
try
{
// 建立引數
SqlParameter[] parameters = {
new SqlParameter("@Operator", SqlDbType.VarChar,20) ,
new SqlParameter("@BillID", SqlDbType.Int) ,
new SqlParameter("@bResult", SqlDbType.VarChar,200) ,
};
// 設定引數型別
parameters[0].Value = model.Operator;
parameters[1].Value = model.StockINID;
parameters[2].Direction = ParameterDirection.Output; // 設定為輸出引數
SqlHelper.ExNonQuery(wdgj31sqlcon, System.Data.CommandType.StoredProcedure, "G_StockINBill_Exec", parameters);
bResult = parameters[2].Value.ToString();
}
catch (Exception ex)
{
}
return bResult;
}