Page 1 of 1

Resolved: How to escape characters like '':$@?" used in SQL CommandText?

Posted: Thu 02 Nov 2017 16:49
by bpipe
PostgreSQL SQL commands can sometimes contain characters (:?) which are treated by ADO. NET provider as placeholder for value from DbParameter. For example those symbols can appear in:
* PostgreSQL type cast - foo::text
* DateTime values formatted as - '02.11.2017 19:39'

I'm trying to execute SQL command containing colon (:) symbols, and they are not intended to be treated as parameters placeholder.
PgSqlCommand cmd;
cmd.CommandText= "UPDATE TABLE 'foo' SET baz= bar::TEXT";
cmd.ExecuteNonQuery(); //Exception here cause parameter :text is missing.

Re: How to escape characters like '':$@?" used in SQL CommandText?

Posted: Fri 03 Nov 2017 10:32
by Pinturiccio
We could not reproduce the issue. Please tell us your dotConnect for PostgreSQL version.

Please also create and send us a small test project with corresponding DDL\DML scripts which reproduces the issue with all characters that you want to escape.

And tell us your PostgreSQL server version.

Re: Resolved: How to escape characters like '':$@?" used in SQL CommandText?

Posted: Fri 03 Nov 2017 13:50
by bpipe
The problem resolved, sorry it was false alert.