Page 1 of 1

Adding query to tableadapter with a where statement "@"

Posted: Wed 21 Jun 2006 14:14
by mrayyan
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,

thanks

Posted: Thu 22 Jun 2006 06:03
by Alexey
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.