我想创建这个查询:
select * from products where number in ('123','234','456');
但我找不到任何与Npgsql和NpgsqlParameter一起使用的示例.我试过这样:
string[] numbers = new string[] { "123","234" }; NpgsqlCommands cmd = new NpgsqlCommands("select * from products where number in (:numbers)"); NpgsqlParameter p = new NpgsqlParameter("numbers",numbers); command.Parameters.Add(p);
但它没有工作;)