I got the following code:
string query = "select * from dbo.Personnel where PersonnelId in ({0})";
string param = "1, 2";
var test = model.ExecuteStoreQuery<Personnel>(query, param).ToList();
I get the following error: "Conversion failed when converting the nvarchar value '1, 2' to data type int."...
Does anyone know how to solve this? What I want is select * from dbo.Personnel where PersonnelId in (1, 2)
but the numbers can be any numbers...
Don't send param to
ExecuteStoreQuery
, just replace{0}
withparam
or