how to add Where condition for (where name in ('abc', 'des','kliop')) in .net API
how to add Where condition for (where name in ('abc', 'des','kliop')) in .net API
Hi All,
I have a question about Where condition syntax in .NET library. I want to run this query:
Select age from table where name in ('abc', 'des','kliop')
based on the documentation here https://editor.datatables.net/manual/net/conditions I used this code:
using (var db = new Database("sqlserver", sqlStr))
{
var response = new Editor(db, "table", "ID")
.Model<pModel>()
.Where( "name", "('abc', 'des','klp')", "IN")
.Process(request)
.Data();
return Ok(response);
}
and it gives me this error: "Incorrect syntax near '@where_0'."
Can you please advise?
Thanks
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Previously answered here:
https://datatables.net/forums/discussion/43542
Thanks!