0

this C# instruction is not working for me I think because of the {message} variable output

string message = null; command = new SqlCommand($"exec ReAppoint '{sid1}', '{sid2}', '{R2.bid}', '{R2.resDate}' , {message} output", connection);

I just wanna know how to save the error message "message" inside C# variable

  • Side point: You should call a stored procedure like this `using (command = new SqlCommand("ReAppoint", connection) { CommandType = CommandType.StoredProcedure }) { command.Parameters.Add("@sid1", SqlDbType.whatever) = sid1 .......` do *not* inject parameters – Charlieface Jan 08 '22 at 20:46

0 Answers0