Creating a tped DataSet for dbase files - Parameters question

M

Mircea Ion

I have an ODBC connection to a folder where a few dbf files reside.
In Visual Studio I'm trying to create a DataSet for this table ZIPS with the
following fields:
ZIP char
PROV char
CITY char

The default Fill and GetData using a SELECT zip, prov, city FROM zips are
created fine, no problem.
Now, let's say I'm trying to create FillByCity and GetDataByCity. In the
query builder I'm constructing
a string like: SELECT zip, prov, city, FROM zips WHERE city = '@city' AND
prov = '@prov'
Executing the query immediately returns a single record populated with nulls
without asking me for values for those parameters.
Of course the query works if I use actual values as parameters.

Is there a different syntax?. Can someone help?

Thank you.
 
R

Rad [Visual C# MVP]

I have an ODBC connection to a folder where a few dbf files reside.
In Visual Studio I'm trying to create a DataSet for this table ZIPS with the
following fields:
ZIP char
PROV char
CITY char

The default Fill and GetData using a SELECT zip, prov, city FROM zips are
created fine, no problem.
Now, let's say I'm trying to create FillByCity and GetDataByCity. In the
query builder I'm constructing
a string like: SELECT zip, prov, city, FROM zips WHERE city = '@city' AND
prov = '@prov'
Executing the query immediately returns a single record populated with nulls
without asking me for values for those parameters.
Of course the query works if I use actual values as parameters.

Is there a different syntax?. Can someone help?

Thank you.

I'm not sure what syntax xbase supports for parameters, but you can try
removing the quotes from around '@city' and '@prov' for a start
 
S

Sudhakar

odbc and oledb queries don't allow named parameters. Instead
you should use "?" on the place of parameters in query.

-sudhakar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top