Best approach for connecting to DB

  • Thread starter Thread starter TCORDON
  • Start date Start date
T

TCORDON

If I want to make an application that connects to eather Access DB, SQL,
Oracle, or uses Web Service. What would me the best way to do it? Any
Samples? Can I create a web reference in Runtime?

Thanks
 
If I want to make an application that connects to eather Access DB, SQL,
Oracle, or uses Web Service. What would me the best way to do it? Any
Samples? Can I create a web reference in Runtime?

For Access/SQL/Oracle you could try the OleDb classes. For maximum
performance, you'll want to create a Factory class that will instantiate
the proper object depending on the server type (i.e. "SqlConnection" for
SQL, "OracleConnection" for Oracle, etc...). Have the factory class
(and the rest of your code) use the generic System.Data interfaces
(IDbCommand, IDbConnection, IDataReader, etc...)
 
TCordon,

You cannot make in my opinion "one" class that is the "best" way to make one
class that connects to Access, SQL and/or Oracle.

For this are 3 seperated classes that you use depending from the kind of
database you use in my opinion a better way.

A webservice has in my opinion nothing to do with the above. You can use
them in a webservice.

I hope this gives some idea's

Cor
 

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

Back
Top