user308551
user308551

Reputation: 31

SqlQuery(statement,params)

I wonder how to do:

params= new object[]{ new SqlParameter("ID",val),new SqlParameter("Label","'%Name%'")};
statement = "Select ID, Label from Country Where ID = ? or or Label Like ?";

I tried and it gave me :

Incorrect syntax near '?'.

Upvotes: 0

Views: 102

Answers (1)

Blorgbeard
Blorgbeard

Reputation: 103467

You have a typo:

"Select ID, Label from Country Where ID = ? or or Label Like ?";

should be

"Select ID, Label from Country Where ID = ? or Label Like ?";

Upvotes: 2

Related Questions