ASP.NET Database Abstraction

J

Joseph Gruber

Hi All.

I'm a PHP programer moving to ASP.NET for this project I'm working
on. The project I'm working on will require that the ASP.NET
application support multiple databases (e.g. Oracle, MySQL and
MSSQL). I've done some google searching but am not finding an answer
to my question. Is there a database abstraction layer for ASP.NET
similar to how there is one for PHP? If not any suggestions/articles
on writing one?

Thanks.

Joseph
 
C

Cowboy \(Gregory A. Beamer\)

Not in the box, but you can download the Enterprise Library, which has a
Data Access block to abstract data connections via a factory method. You
then use config to switch. You would have to write the MySQL implementation,
but the classes are fairly easy to dink with once you understand the inner
workings. A few years ago, I created an Oracle version for the Data Access
Block, when there was none. It was pretty much just copy and alter, with a
few tweaks to fit the Oracle means of doing things.

I am sure there is also a third party abstraction out there somewhere,
perhaps open source. For open source, look at sourceforge.net and
codeplex.com.

If you have to write your own, you might look at the Design Pattern
Framework from dofactory.com. Other options include using a code gen. There
are a variety here you can try: IronSpeed, Genome, LLBLGen Pro, CodeSmith
with .NET Tiers, etc.

Of the various code gens, I currently like LLBLGen Pro the best, as it more
efficiently uses database connections, especially when lazy loading a
collection. I am currently playing with IronSpeed and have a copy of Genome
for review. There are also some open source implementations. NHibernate, for
example, allows you to control the output via XML templates.
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top