Whats the proper way of accessing a database through an assembly?

Posted by H4mm3rHead on Stack Overflow See other posts from Stack Overflow or by H4mm3rHead
Published on 2010-04-06T17:18:59Z Indexed on 2010/04/06 17:23 UTC
Read the original article Hit count: 256

Filed under:
|
|
|

Hi, I have a ASP.NET MVC application which is build up as an assembly that queries the database and a asp.net frontend that references this assembly and this assembly abstracts the underlying database. This means that my Assembly contains a app.config file that contains the connectionstring to the database (Linq to Sql data model). How do I go about making this more flexible? Should i make a "initialize()" method somewhere in my assembly which takes the connection string from the asp.net mvc application and then that controls which database to use? or how is this done?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about mvc