JORGEMAL wrote:Did you write C# and tested the SIMILARITY function?
If so, would you show me your code so I can go over it and see what I am doing wrong?
Yes, i did. I'm posting my sample here:
Code: Select all
PgSqlConnection conn = new PgSqlConnection("host=localhost;port=5434;user id=postgres;password=postgres;");
conn.Open();
PgSqlCommand comm = new PgSqlCommand("select dname, similarity(dname, 'Hillo') from dept where similarity(dname, 'Hillo') 1 AND similarity(dname, 'Hillo') >= 0", conn);
PgSqlDataReader reader = comm.ExecuteReader();
while (reader.Read())
{
for (int i = 0; i < reader.FieldCount; i++)
Console.Write(reader.GetValue(i) + "\t");
Console.WriteLine();
}
I have received the same error as you, before installing pg_trgm and creating pg_trgm EXTENSION. Now use the pg_trgm functions in pgAdmin III and in C# code with dotCOnnect for PostgreSQL.
Please make sure that you can run queries with pg_trgm functions in pgAdmin III. Then you can use these funtions with dotConnect for PostgreSQL but only with the same database.