By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,313 Members | 1,145 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,313 IT Pros & Developers. It's quick & easy.

ASP.NET Database Abstraction

P: n/a
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

Oct 30 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
See my post here:

http://groups.google.com/group/micro...c9b0924188effa
where I talk about the EnterpriseLibrary.Data AND the Factory Design
Pattern to deal with multiple database support.
"Joseph Gruber" <jo***********@gmail.comwrote in message
news:11*********************@22g2000hsm.googlegrou ps.com...
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

Oct 30 '07 #2

P: n/a
"Joseph Gruber" <jo***********@gmail.comwrote in message
news:11*********************@22g2000hsm.googlegrou ps.com...
Is there a database abstraction layer for ASP.NET
There most certainly is:
http://msdn.microsoft.com/msdnmag/is...07/DataPoints/

Comes pre-configured for SQL Server, but includes instructions on how to add
Oracle which you can use as a guideline for adding other providers...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 30 '07 #3

P: n/a
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.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
"Joseph Gruber" <jo***********@gmail.comwrote in message
news:11*********************@22g2000hsm.googlegrou ps.com...
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

Oct 30 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.