Connection information in Data Layer

G

Guest

Hello all - just a spot of advice required.

I'm wanting to write a number of data layers that will be used to carry out
the typical CRUD operations against a database - so 1 database will be linked
to 1 data layer. However, I'm aware that typically the connection
information, such as the connection string, would be retrived from, in our
case, the Web.Config file. This would obviously mean that the user would then
have to know this information, but I'll like to try and make it as "plug and
play" as possible, i.e. add the reference and begin using the data layer
methods.

My question is therefore, where is the best place for these Data Layers to
pick up their connection information? Could/can each layer have it's own
"config" type file?

Thanks for any advice,

Jon
 
S

sloan

The config file usually lays with the top or presentation layer.


This would obviously mean that the user would then
have to know this information,
The web.config file is not downloadable by an end user. So it shouldn't be
known to the end user.
I'm not sure if you mean "end user" or "person who deploys the application
on a webserver", but if its "end user", then your assumption is wrong.
...

Can you place a config file with the assembly?

Yes, but you have to write some code (or find some)
Try
http://www.eggheadcafe.com/forums/ForumPost.asp?id=85647&ThreadID=85647&INTID=6



web.config is the place to put this info.

or, if you use the EnterpriseLibrary.Data .. then in a file called
dataConfiguration.config.
Which, the more I used EnterpriseLibrary.Data and this little
dataConfiguration.config file, the more I like it.
 

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

Top