var hid = new SqlParameter {parametername = "Historyid", Value = history. Id, Direction = parameterdirection.input};var sid = New SqlParameter {parametername = "StoreId", Value = StoreId, Direct Ion = ParameterDirection.Input};var QRCode = new SqlParameter {parametername = "QRCode", Value = strqrcode, Direction = ParameterDirection.Input};var Guidcode = new SqlParameter {parametername = "Guidcode", Value = strguidcode, Direction = ParameterDirection.Input};var result = new SqlParameter {parametername = "result", Value = 0, Direction = Parameterdirec tion. Output};d B. Database.executesqlcommand ("exec @Result = Optstock @HistoryId, @StoreId, @QRCode, @GUIDCode", HID, sid, QRCode, Guidcode , result); model. Status = (int) result. Value;
The stored procedure is optstock with parameter input, output
MVC C # Stored procedures that call SQL