I'm trying to call the below stored procedure to display a list of products with a certain product type.
CREATE PROCEDURE filterListSP
@productType varchar (25)
AS
BEGIN
SET NOCOUNT ON;
SELECT
ProductId, Description, Price
FROM
tblProduct
WHERE
ProductType = @productType
END
GO
And this is the code calling the SP:
dataGridView1.DataSource = naafiDbEntity.Database.SqlQuery<tblProductType>
("filterListSP @productType", cboFilter.SelectedValue).ToList();
However, when I run this code I get the following error:
Must declare the scalar variable "@productType"
Can anyone tell me what I'm missing?