Adding query to tableadapter with a where statement "@"

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
Posts: 1
Joined: Wed 21 Jun 2006 14:11

Adding query to tableadapter with a where statement "@"

Post by mrayyan » Wed 21 Jun 2006 14:14

Hello everyone,

I have a little problem and plus i am new to this.

With MSSQL I was able to use where statement in my queries using "@" for example:

Code: Select all

SELECT * from table where ID = @variable
but with Postgres, it doesnt recognize it and throws me a fit. Is there a replacement for that?

let me know,


Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Thu 22 Jun 2006 06:03

It ought to recognize "@" character. Try to use the code below:

Code: Select all

      pgSqlCommand1.CommandText = "SELECT * from table where ID = @variable";
      pgSqlCommand1.Parameters.Add("@variable", 1);
For more information please refer to "Using Parameters" article of PostgreSQLDirect .NET help documentation.

Post Reply