Adding query to tableadapter with a where statement "@"

Adding query to tableadapter with a where statement "@"

Postby 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,

thanks
mrayyan
 
Posts: 1
Joined: Wed 21 Jun 2006 14:11

Postby 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.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for PostgreSQL