By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,183 Members | 1,179 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,183 IT Pros & Developers. It's quick & easy.

Database Location in a Multitier Soulution

P: n/a
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
mf*******@networkclub.co.uk
Mar 17 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
With Access, the Connection String determines the location of the database
file.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

"Martyn Fewtrell" <mf*******@networkclub.co.uk> wrote in message
news:eo**************@TK2MSFTNGP14.phx.gbl...
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
mf*******@networkclub.co.uk

Mar 17 '06 #2

P: n/a
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" <mf*******@networkclub.co.uk> wrote in message
news:eo**************@TK2MSFTNGP14.phx.gbl...
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
mf*******@networkclub.co.uk

Mar 17 '06 #3

P: n/a
Thanks for both replies.

I am aware that the connection string defines (or at least points to) the
location of the database. Currently I have the live database located on a
folder on the web server, with a duplicate database on the same relative
path on the workstation. i.e. two copies of the database . When working
within VS2005 all the design time functions work as it hits the database on
the workstation and when I test the project it still works as the project on
the web server hits the real database at the same relative path on the web
server and I don't need to rewrite the connection string. Its just all a bit
messy having two copies of the database and thought there might be a better
option.

Martyn Fewtrell
mf*******@networkclub.co.uk

"Martyn Fewtrell" <mf*******@networkclub.co.uk> wrote in message
news:eo**************@TK2MSFTNGP14.phx.gbl...
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
mf*******@networkclub.co.uk

Mar 17 '06 #4

P: n/a
Perhaps using an absolute path would be better?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

"Martyn Fewtrell" <mf*******@networkclub.co.uk> wrote in message
news:ek**************@TK2MSFTNGP11.phx.gbl...
Thanks for both replies.

I am aware that the connection string defines (or at least points to) the
location of the database. Currently I have the live database located on a
folder on the web server, with a duplicate database on the same relative
path on the workstation. i.e. two copies of the database . When working
within VS2005 all the design time functions work as it hits the database
on the workstation and when I test the project it still works as the
project on the web server hits the real database at the same relative path
on the web server and I don't need to rewrite the connection string. Its
just all a bit messy having two copies of the database and thought there
might be a better option.

Martyn Fewtrell
mf*******@networkclub.co.uk

"Martyn Fewtrell" <mf*******@networkclub.co.uk> wrote in message
news:eo**************@TK2MSFTNGP14.phx.gbl...
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
mf*******@networkclub.co.uk


Mar 17 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.