I am getting error
Procedure expects parameter '@statement' of type 'ntext/nchar/nvarchar'
while executing a stored procedure with Entity Framework.
This is my stored procedure:
CREATE PROCEDURE [dbo].[usp_RolesList]
(@WhereCond VARCHAR(50))
AS
BEGIN
SET NoCount ON
DECLARE @SQLQuery AS VARCHAR(MAX)
SET @SQLQuery = 'Select * From dbo.AspNetRoles ' + @WhereCond
EXECUTE sp_Executesql @SQLQuery
END
and this is my c# code that I am using for executing the results
var idParam = new SqlParameter
{
ParameterName = "WhereCond",
Value = "where Id > 0"
};
var courseList = ctx.Database.SqlQuery<UserRoles>("exec usp_RolesList @WhereCond ", idParam).ToList<UserRoles>();
@SQLQuerytonvarchar(max)- Nikhil Agrawal@WhereCond- Nikhil Agrawal