Stored procedure:
ALTER PROCEDURE VendorsRowcount
@RowCount int OUTPUT
AS
SET NOCOUNT ON
SELECT *
FROM dbo.Vendors
SET @RowCount = @@ROWCOUNT
RETURN @RowCount
C#:
using (var conn = new SqlConnection("Data Source=.\\SQLEXPRESS;Initial Catalog=Pricer;Persist Security Info=True;User ID=xxx;Password=xxx"))
using (var command = new SqlCommand("VendorsRowcount", conn)
{
CommandType = CommandType.StoredProcedure
})
{
conn.Open();
command.ExecuteNonQuery();
conn.Close();
}
I am getting the error:
Additional information: Procedure or function 'VendorsRowcount' expects parameter '@RowCount', which was not supplied.
I am just learning C# after setting out to learn VB and realizing that there are a lot more resources on the internet for C#.
This is probably a stupid question, but I have searched and maybe the terms I use are not the correct ones, because I can not find an answer.
To the best of my knowledge, I don't need to send a parameter because @RowCount
is output.
Why do I get this error?