You should use a persistence framework to provide an additional layer of
abstraction. I've written one and released it as open source (LGPL,
which means you can use it in commercial apps too). It's called Gentle
and currently supports SQL Server, Access/Jet/Ole, MySQL, PostgreSQL,
SQLite. Firebird/Interbase support is in the works.
It generates all the sql for simple object IO and provides an SqlBuilder
for constructing more complicated queries. It does not support n:m
relations at the moment, so if you need complicated joins you have to
execute custom sql, but can still benefit from the other features (such
as automatic result parsing and object construction).
You can visit the workspace (and download the latest source) here:
http://workspaces.gotdotnet.com/gentle
I realise this all sounds a bit marketing-like, but I really believe in
the benefit of using such a framework. ObjectSpaces is similar (in
features if not in approach) but is unlikely to support very many
databases (at least for quite a while). There's also something called
Matchbox, which is similar to Gentle but less advanced. Also, there is
OJB.NET, which looks very nice but probably doesn't perform (it uses
ContextBound objects and ContextAttributes afaik). There's also a ton of
commercial apps available if you have the dough.
If you wish to go with Gentle, there's a quick-start tutorial here:
http://www.mertner.com/projects/gentle
Yours,
Morten