Hi, all! We have received some users questions about how to send a list of values to be used in queries using the "in" operator. Something like: select foo, bar from table where foo in (blah1, blah2, blah3); Npgsql supports array-like parameter values and the first idea to have this working would try to use it directly: NpgsqlCommand command = new NpgsqlCommand("select * from tablee where field_serial in (:parameterlist)", conn); ArrayList l = new ArrayList(); l.Add(5); l.Add(6); command.Parameters.Add(new NpgsqlParameter("parameterlist", NpgsqlDbType.Array | NpgsqlDbType.Integer)); command.Parameters[0].Value = l.ToArray(); NpgsqlDataReader dr = command.ExecuteReader(); but unfortunately this won't work as expected. Npgsql will send a query like this: select * from tablee where field_serial in ((array[5,6])::int4[]) And Postgresql will complain with the followin...
Comments
Anyway, you got the names wrong, my writing must be really awful :) : Alin Hanghiuc, Brasov, Romania.
You can be friends with me. Please come visit my site Eye surgeons when you got time. Thanks.
give me any valuable feedbacks.
when you got time.
btw i love your blog although i have just stumbled upon it =)
Love the new pictures you got there! I would love some feedback on my site Suzhou City guide – hotels when you got time.
Please come visit my site
cosmetic dentists edinburgh
when you got time.
It is cute!
undermount sinks