473,387 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Connection information in Data Layer

Jon
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
Nov 13 '06 #1
1 1188

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/Fo...=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.

"Jon" <Jo*@discussions.microsoft.comwrote in message
news:7F**********************************@microsof t.com...
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

Nov 13 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bob | last post by:
I have an ASP.NET web application that has been running without any problems for a while. I recently transferred the site to shared hosting and had multiple users start to use the site. The problem...
3
by: Varun | last post by:
I have a solution which contains windows,web,mobile presentations. Now i want to share the connection string in the web.config file. i want to write a method in a common layer where i can retrieve...
6
by: H | last post by:
This is a question that has haunted me for quite some time. if you build a 4 tier database application where the 4th tier is the database server (MS SQL 2000), where do you build the connection...
6
by: Steven Blair | last post by:
Hi, I am writing an application using a 3 tier model (Client, Business Layer and DB) The DB layer creates a OdbcDataReader object back up to the Client where the data is read and displayed on...
7
by: Gary Brizard | last post by:
OK. For an n-tier architecture, where is the best place to store the connection string for the DA layer? I don't want to use the reg. Can't use a app.config for a dll. For other projects I...
2
by: AS | last post by:
Hi, I have a C# windows desktop application that will be used only by one user at a time. The database server (SQL Server 2000) also resides on that machine only. This application has three...
16
by: crbd98 | last post by:
Hello All, Some time ago, I implemented a data access layer that included a simple connectin pool. At the time, I did it all by myself: I created N connections, each connection associated with...
20
by: Author | last post by:
a .net 1.1 app has a class whose constructor opens a db connection to sql svr two thousand. this class has more than a dozen of methods. most of them don't do db stuff. I am wondering if this...
1
by: Dean Slindee | last post by:
VS2008, .NetFramework 3.5 SP1: I have built a LINQ data access layer project. When the LINQ data context was built over an existing SQL2005 database, the connection string for that database was...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.