If use the following query script for creating a TableAdapter method, like “GetDataById”, when using OLEDB:

“SELECT * FROM aTable WHERE theID=@id”

an error will happen:

“error in where clause near ‘@’ unable to parse query text”

The solution is to use “?”, instead of “@variablename”, so teh following will succeed:

“SELECT * FROM aTable WHERE theID=?”

Leave a Reply