You need to define a length when specifying the varchar parameter:
SqlParameter TheFirstJob = cmd.Parameters.Add("@spParam", SqlDbType.VarChar, 50);
Note: You should use the same length as defined in your SQL Server stored procedure.
Daily micro-tips for C#, SQL, performance, and scalable backend engineering.
You need to define a length when specifying the varchar parameter:
SqlParameter TheFirstJob = cmd.Parameters.Add("@spParam", SqlDbType.VarChar, 50);
Note: You should use the same length as defined in your SQL Server stored procedure.