Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Override class objects

Status
Not open for further replies.

Denster

Programmer
Apr 9, 2001
198
GB
I am using VB.Net to produce a website with database access. I would like to cater for a number of databases such as sqlServer, Mysql, Oracle etc... Ideally I want to have a data access class for each type of database which would have identical functions. Then have something in the web.config file to tell the application which class to use. I think this will then need some kind of provider class to retrieve the required information from the web.config and act as a link between the logic layer and the data access layer. Am I on the right lines? and if so how do I go about the provider class.
 
the best approach is to use a tool that already solved the data access problem. Nhibernate is a solid OSS project with a great user base on google groups. there are other as well ActiveRecord (also OSS), LLBL Gen Pro ($). those are the big 3.

if this isn't an option use the System.Data.Common.DbProviderFactories.GetFactory() to manage your polymorphism. using the connectionstring node in the configuration file and ConfigurationManager you can build db agnostic code. the one catch is you need to ensure your sql statments translate across all databases.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top