Re: Database Location in a Multitier Soulution
- From: "William Buchanan" <william.buchanan@xxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 17 Mar 2006 12:15:16 -0000
Really, it doesn't matter where the DB file is. What matters is the
connection string (as Kevin has pointed out). When you deploy your site, the
DB might end up somewhere completely different, so you can't rely on it
being in the App_Data folder anyway.
What you will have to do though....
When you create your data layer (I guess this will be in a separate class
library dll), you will notice that it gets its own app.config file which
also has a connection string in it. When you deploy your site, you will have
to move this connection string from the app.config into the
<connectionstrings> section in the web applications web.config file.
Will
"Martyn Fewtrell" <mfewtrell@xxxxxxxxxxxxxxxxx> wrote in message
news:eo1eiVbSGHA.5552@xxxxxxxxxxxxxxxxxxxxxxx
Hi there
I am just canvassing some opinions so feel free to add yours.
I mainly work with VB.Net on dynamic websites driven by Access and have
more recently been trying to introduce Business and Data layers. Most of
my projects are fairly small so the justification for the extra work is
marginal but it helps to clean up the projects and I can see the value.
However this is my issue.
By default if you add an Access database to a web project VS2005 likes to
place it within the App_Data folder which is fine if you want to use it
from within the same project. If you introduce the concept of a DataAccess
layer then how does the DataAccess layer connect to the database during
development (VS2005 needs to se the database). I assume that once the
DataAccess layer is compiled the DLL gets added to the Bin folder of the
web project so accessing the App_Data folder isn't a problem at that
stage. To make things worse during development I work against an IIS
development server running on Win2003 (set up to mirror my live hosting
environment) but my Visual Studio Projects are stored in the MyDocuments
folder of my workstation which happen to be redirected onto a different
server (which is backed up each night). If I create a solution in VS2005
the website is on one server, any other VB projects end up on the other
server and VS2005 is on my workstation.
Obviously with an SQL project this isn't an issue as I can hit the
database from anywhere in the network.
I'm just curious as to how other web developers set up their working
environments and/or get around this problem.
Your views please.
Martyn Fewtrell
mfewtrell@xxxxxxxxxxxxxxxxx
.
- References:
- Database Location in a Multitier Soulution
- From: Martyn Fewtrell
- Database Location in a Multitier Soulution
- Prev by Date: Re: store custom control in cache
- Next by Date: Datagrid and Back Button
- Previous by thread: Re: Database Location in a Multitier Soulution
- Next by thread: Re: Database Location in a Multitier Soulution
- Index(es):