473,732 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1201

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 EnterpriseLibra ry.Data .. then in a file called
dataConfigurati on.config.
Which, the more I used EnterpriseLibra ry.Data and this little
dataConfigurati on.config file, the more I like it.

"Jon" <Jo*@discussion s.microsoft.com wrote in message
news:7F******** *************** ***********@mic rosoft.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
5374
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 I'm experiencing is that when many users are hitting the site at once, occasionaly I will see errors. The 3 most common ones are: "The SqlCommand is currently busy Open, Fetching. ", "Internal Connection Fatal Error", "object reference not set to...
3
2151
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 the connection string for all the presentations layers How can i do that? Any suggestions or urls are suggested? Thank you
6
2158
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 string? The obvious answer is to hard code it into the middle layer and use a config file. The problem is the database application needs to be distributed to purchasing clients. Therefore, you do not know, at development, what the SQL
6
1852
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 the screen. I then call the Close method of this OdbcDataReader. I had assumed this closed the connection to the Database, but apparently not (using processlist in MySQL confirmed the connections were not being closed). How can I successfully...
7
1683
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 exposed the DA layer through a we service and store the connection string in the web.config file. Any recommendations? Thanks.
2
3065
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 logical layers (UI, Business layer and DataAccess layer). Currently, SQL Server connection is opened when a user first logs in. This connection object (a global variable) is passed from every form to the business layer and then to the data
16
2871
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 a worker thread that would execute the db commands. The pool was fixed and all the connections were created when the db access class was instantiated. The connections remained opened during the whole execution. If a connection was not available...
20
5617
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 design is going to be a problem, bcoz each time this class is instantiated, a db conn is open. The worst thing is that I haven't seen anywhere in the code the db conn is closed. I write about this bcoz I see that this app leaves more than one...
1
6316
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 correctly, automatically, placed into the Settings for the LINQ project. It works, but it's a "static" connection string. I would like to be able to use this one LINQ data access layer against both test and production databases without having...
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9307
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9235
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9181
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.