In my procedure
I have the following variables:
@Codigo VARCHAR(MAX),@cont as int, @DataPago as VARCHAR(10)
Via C # application I'm passing the values as follows:
y1.Parameters.Add("@Codigo", SqlDbType.VarChar).Value = "2,4";
y1.Parameters.Add("@cont", SqlDbType.Int).Value = 1;
y1.Parameters.Add("@DataPago", SqlDbType.VarChar, 10).Value = "20/05/2015";
The problem is that I'm getting the following error:
Conversion failed when converting the varchar value '2,4' to data type int.
However, when I put the direct value into my procedure, it works, as below:
WHERE P.RELATORIO in (2,4)