Basic ADO.net questions

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

I'm able to connect fine to a FoxPro tables (*.dbf files) easy enough.
But when I'm doing a query, what's the most efficient way of doing it?
Which object should I be playing with if I need to return, say, all
the records with an 812 exchange?

Also, there exists indexes for many tables at my place of work. Can I
use them, somehow, to make my searches and queries run quicker?
 
Hi Alex,

Alex said:
I'm able to connect fine to a FoxPro tables (*.dbf files) easy enough.
But when I'm doing a query, what's the most efficient way of doing it?
Which object should I be playing with if I need to return, say, all
the records with an 812 exchange?

If you need only to read them you might use reader object.
If you need to store or update them then you should use adapter and its fill
method to fill a DataTable.
Also, there exists indexes for many tables at my place of work. Can I
use them, somehow, to make my searches and queries run quicker?

I think that they should be used automatically if you format your sql
statement properly. Not sure on how fox handles the issue.
 
Alex,

SQL is a set-oriented language. Each database that understands SQL has a
query optimizer that decides based on what you're asking for what indexes to
use to optimize the query.

In the case of FoxPro, it uses a technology called Rushmore to do this even
with its own embedded SQL and with its own data maniuplation language. In
fact it's one of the finest there is, and one of the reasons Microsoft
purchased Fox over 10 years ago was to acquire this technology, which has
found its way into SQL Server itself over the years, as well as the ADO and
ADO.NET engines and (in semi-crippled form) Jet / Access.

Assuming you are actually talking to Fox via its OLE-DB driver (or its older
ODBC driver), and the DBF is part of a FoxPro database (DBC), queries are
optimized using available indexes. If you are simply accessing a DBF using
a Microsoft desktop driver, or if the DBF is a "free table" I'm not so sure
if that uses indexes. The reason being, how would it even know what index
file(s) go with that table?

--Bob
 
Back
Top