int SearchId = 0;
string Criteria = "you're";
PgSqlCommand cmd = new PgSqlCommand("SELECT public.createsearchresult(@querystring_in);", DBUtils.GetConnection());
cmd.Parameters.Add(new PgSqlParameter("@querystring_in", PgSqlType.VarChar, 100));
cmd.Parameters["@querystring_in"].Value = "%" + Criteria + "%";
cmd.Connection.Open();
cmd.ExecuteNonQuery();
cmd.Connection.Close();
results in:
CoreLab.PostgreSql.PgSqlException: syntax error at or near "re"
---
Is this expected behavior? I would have expected this to properly escape single quotes as with other VarChar parameters.
Cleaning Of VarChar PgSqlParameter To Function
-
- Posts: 7
- Joined: Mon 24 Apr 2006 14:30
-
- Posts: 7
- Joined: Mon 24 Apr 2006 14:30