I created a SQL Server database project (VS2017) and I added a SQLCLR C# stored procedure. It's declared like this:
public static void RequestServiceToEncryptPassword(byte[] param1, out int param2, out byte[] param3)
I also have a Windows Forms application that connects to the database and I try to execute this procedure like this:
sqlCommand = new SqlCommand(procName, sqlConnection);
sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
sqlCommand.Parameters.AddWithValue("param1", param1).Direction = System.Data.ParameterDirection.Input;
sqlCommand.Parameters.AddWithValue("param2", int).Direction = System.Data.ParameterDirection.Output;
sqlCommand.Parameters.AddWithValue("param3", byte[]).Direction = System.Data.ParameterDirection.Output;
There's a problem with declared data type though. What is the correct way of declaring data types for SQLCLR stored procedures or getting its output parameter values?