Connection strings

G

Gary Brizard

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.
 
K

Kevin Yu [MSFT]

Hi Gary,

You can try to put the connection string in the app.config file of an .exe
file. When calling the DataAccess layer, you can pass the string as a
parameter. Or you can save the connection string in a text or XML file,
since it's just a string.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

--------------------
| Reply-To: "Gary Brizard" <[email protected]>
| From: "Gary Brizard" <[email protected]>
| Subject: Connection strings
| Date: Tue, 14 Oct 2003 15:42:46 -0700
| Lines: 7
| Organization: Pala Casino
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: 216.190.36.99
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXA06.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
8.phx.gbl!tk2msftngp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:146738
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| 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.
|
|
|
 
N

Nice Chap

Hi Gary, Kevin's idea of passing the Connection String as a Parameter is a
very good way of passing information as it reduces the degree of 'surprise'
in the DA behaviour and also gives the consumer of the DA more control.
 
K

Kevin Yu [MSFT]

Thanks Nice.

Gary, I've found an article in MSDN which contains how to store connection
string in a .NET data access architecture.

Please refer to the following link:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/
daag.asp

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

--------------------
| From: "Nice Chap" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: Re: Connection strings
| Date: Wed, 15 Oct 2003 14:37:23 +0100
| Lines: 52
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <elx#[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: news.lynxfs.net 193.130.133.162
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:146865
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Hi Gary, Kevin's idea of passing the Connection String as a Parameter is a
| very good way of passing information as it reduces the degree of
'surprise'
| in the DA behaviour and also gives the consumer of the DA more control.
|
| | > Hi Gary,
| >
| > You can try to put the connection string in the app.config file of an
.exe
| > file. When calling the DataAccess layer, you can pass the string as a
| > parameter. Or you can save the connection string in a text or XML file,
| > since it's just a string.
| >
| > Kevin Yu
| > =======
| > "This posting is provided "AS IS" with no warranties, and confers no
| > rights."
| >
| > --------------------
| > | Reply-To: "Gary Brizard" <[email protected]>
| > | From: "Gary Brizard" <[email protected]>
| > | Subject: Connection strings
| > | Date: Tue, 14 Oct 2003 15:42:46 -0700
| > | Lines: 7
| > | Organization: Pala Casino
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <[email protected]>
| > | Newsgroups: microsoft.public.dotnet.languages.vb
| > | NNTP-Posting-Host: 216.190.36.99
| > | Path:
| >
|
cpmsftngxa06.phx.gbl!TK2MSFTNGXA06.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
| > 8.phx.gbl!tk2msftngp13.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:146738
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > |
| > | 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.
| > |
| > |
| > |
| >
|
|
|
 
N

Nice Chap

Kevin, thanks for the link but unfortunately the page has restricted access.
Can you kindly copy and paste the article onto here pl ?
 
K

Kevin Yu [MSFT]

Hi Nice,

It was too long and contains many images. I think you can search in
http://msdn.microsoft.com for ".NET Data Access Architecture Guide".

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

--------------------
| From: "Nice Chap" <[email protected]>
| References: <[email protected]>
<[email protected]>
<elx#[email protected]>
<[email protected]>
| Subject: Re: Connection strings
| Date: Thu, 16 Oct 2003 08:45:07 +0100
| Lines: 105
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: news.lynxfs.net 193.130.133.162
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:147200
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Kevin, thanks for the link but unfortunately the page has restricted
access.
| Can you kindly copy and paste the article onto here pl ?
|
| | > Thanks Nice.
| >
| > Gary, I've found an article in MSDN which contains how to store
connection
| > string in a .NET data access architecture.
| >
| > Please refer to the following link:
| >
| >
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/
| > daag.asp
| >
| > Kevin Yu
| > =======
| > "This posting is provided "AS IS" with no warranties, and confers no
| > rights."
| >
| > --------------------
| > | From: "Nice Chap" <[email protected]>
| > | References: <[email protected]>
| > <[email protected]>
| > | Subject: Re: Connection strings
| > | Date: Wed, 15 Oct 2003 14:37:23 +0100
| > | Lines: 52
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <elx#[email protected]>
| > | Newsgroups: microsoft.public.dotnet.languages.vb
| > | NNTP-Posting-Host: news.lynxfs.net 193.130.133.162
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:146865
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > |
| > | Hi Gary, Kevin's idea of passing the Connection String as a Parameter
is
| a
| > | very good way of passing information as it reduces the degree of
| > 'surprise'
| > | in the DA behaviour and also gives the consumer of the DA more
control.
| > |
| > | | > | > Hi Gary,
| > | >
| > | > You can try to put the connection string in the app.config file of
an
| > exe
| > | > file. When calling the DataAccess layer, you can pass the string as
a
| > | > parameter. Or you can save the connection string in a text or XML
| file,
| > | > since it's just a string.
| > | >
| > | > Kevin Yu
| > | > =======
| > | > "This posting is provided "AS IS" with no warranties, and confers no
| > | > rights."
| > | >
| > | > --------------------
| > | > | Reply-To: "Gary Brizard" <[email protected]>
| > | > | From: "Gary Brizard" <[email protected]>
| > | > | Subject: Connection strings
| > | > | Date: Tue, 14 Oct 2003 15:42:46 -0700
| > | > | Lines: 7
| > | > | Organization: Pala Casino
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | Message-ID: <[email protected]>
| > | > | Newsgroups: microsoft.public.dotnet.languages.vb
| > | > | NNTP-Posting-Host: 216.190.36.99
| > | > | Path:
| > | >
| > |
| >
|
cpmsftngxa06.phx.gbl!TK2MSFTNGXA06.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
| > | > 8.phx.gbl!tk2msftngp13.phx.gbl
| > | > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.languages.vb:146738
| > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > | > |
| > | > | 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.
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|
 
N

Nice Chap

Thanks Kevin...

Kevin Yu said:
Hi Nice,

It was too long and contains many images. I think you can search in
http://msdn.microsoft.com for ".NET Data Access Architecture Guide".

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

--------------------
| From: "Nice Chap" <[email protected]>
| References: <[email protected]>
<[email protected]>
<elx#[email protected]>
<[email protected]>
| Subject: Re: Connection strings
| Date: Thu, 16 Oct 2003 08:45:07 +0100
| Lines: 105
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: news.lynxfs.net 193.130.133.162
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:147200
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Kevin, thanks for the link but unfortunately the page has restricted
access.
| Can you kindly copy and paste the article onto here pl ?
|
| | > Thanks Nice.
| >
| > Gary, I've found an article in MSDN which contains how to store
connection
| > string in a .NET data access architecture.
| >
| > Please refer to the following link:
| >
| >
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/
| > daag.asp
| >
| > Kevin Yu
| > =======
| > "This posting is provided "AS IS" with no warranties, and confers no
| > rights."
| >
| > --------------------
| > | From: "Nice Chap" <[email protected]>
| > | References: <[email protected]>
| > <[email protected]>
| > | Subject: Re: Connection strings
| > | Date: Wed, 15 Oct 2003 14:37:23 +0100
| > | Lines: 52
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <elx#[email protected]>
| > | Newsgroups: microsoft.public.dotnet.languages.vb
| > | NNTP-Posting-Host: news.lynxfs.net 193.130.133.162
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:146865
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > |
| > | Hi Gary, Kevin's idea of passing the Connection String as a Parameter
is
| a
| > | very good way of passing information as it reduces the degree of
| > 'surprise'
| > | in the DA behaviour and also gives the consumer of the DA more
control.
| > |
| > | | > | > Hi Gary,
| > | >
| > | > You can try to put the connection string in the app.config file of
an
| > exe
| > | > file. When calling the DataAccess layer, you can pass the string as
a
| > | > parameter. Or you can save the connection string in a text or XML
| file,
| > | > since it's just a string.
| > | >
| > | > Kevin Yu
| > | > =======
| > | > "This posting is provided "AS IS" with no warranties, and confers no
| > | > rights."
| > | >
| > | > --------------------
| > | > | Reply-To: "Gary Brizard" <[email protected]>
| > | > | From: "Gary Brizard" <[email protected]>
| > | > | Subject: Connection strings
| > | > | Date: Tue, 14 Oct 2003 15:42:46 -0700
| > | > | Lines: 7
| > | > | Organization: Pala Casino
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | Message-ID: <[email protected]>
| > | > | Newsgroups: microsoft.public.dotnet.languages.vb
| > | > | NNTP-Posting-Host: 216.190.36.99
| > | > | Path:
| > | >
| > |
| >
|
cpmsftngxa06.phx.gbl!TK2MSFTNGXA06.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
| > | > 8.phx.gbl!tk2msftngp13.phx.gbl
| > | > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.languages.vb:146738
| > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > | > |
| > | > | 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.
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|
 
K

Kevin Yu [MSFT]

You're welcome!

--------------------
| From: "Nice Chap" <[email protected]>
| References: <[email protected]>
<[email protected]>
<elx#[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Connection strings
| Date: Thu, 16 Oct 2003 11:20:28 +0100
| Lines: 161
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: news.lynxfs.net 193.130.133.162
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:147232
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Thanks Kevin...
|
| | > Hi Nice,
| >
| > It was too long and contains many images. I think you can search in
| > http://msdn.microsoft.com for ".NET Data Access Architecture Guide".
| >
| > Kevin Yu
| > =======
| > "This posting is provided "AS IS" with no warranties, and confers no
| > rights."
| >
| > --------------------
| > | From: "Nice Chap" <[email protected]>
| > | References: <[email protected]>
| > <[email protected]>
| > <elx#[email protected]>
| > <[email protected]>
| > | Subject: Re: Connection strings
| > | Date: Thu, 16 Oct 2003 08:45:07 +0100
| > | Lines: 105
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <[email protected]>
| > | Newsgroups: microsoft.public.dotnet.languages.vb
| > | NNTP-Posting-Host: news.lynxfs.net 193.130.133.162
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:147200
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > |
| > | Kevin, thanks for the link but unfortunately the page has restricted
| > access.
| > | Can you kindly copy and paste the article onto here pl ?
| > |
| > | | > | > Thanks Nice.
| > | >
| > | > Gary, I've found an article in MSDN which contains how to store
| > connection
| > | > string in a .NET data access architecture.
| > | >
| > | > Please refer to the following link:
| > | >
| > | >
| > |
| >
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/
| > | > daag.asp
| > | >
| > | > Kevin Yu
| > | > =======
| > | > "This posting is provided "AS IS" with no warranties, and confers no
| > | > rights."
| > | >
| > | > --------------------
| > | > | From: "Nice Chap" <[email protected]>
| > | > | References: <[email protected]>
| > | > <[email protected]>
| > | > | Subject: Re: Connection strings
| > | > | Date: Wed, 15 Oct 2003 14:37:23 +0100
| > | > | Lines: 52
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | Message-ID: <elx#[email protected]>
| > | > | Newsgroups: microsoft.public.dotnet.languages.vb
| > | > | NNTP-Posting-Host: news.lynxfs.net 193.130.133.162
| > | > | Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| > | > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.languages.vb:146865
| > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > | > |
| > | > | Hi Gary, Kevin's idea of passing the Connection String as a
| Parameter
| > is
| > | a
| > | > | very good way of passing information as it reduces the degree of
| > | > 'surprise'
| > | > | in the DA behaviour and also gives the consumer of the DA more
| > control.
| > | > |
| > | > | | > | > | > Hi Gary,
| > | > | >
| > | > | > You can try to put the connection string in the app.config file
of
| > an
| > | > exe
| > | > | > file. When calling the DataAccess layer, you can pass the string
| as
| > a
| > | > | > parameter. Or you can save the connection string in a text or
XML
| > | file,
| > | > | > since it's just a string.
| > | > | >
| > | > | > Kevin Yu
| > | > | > =======
| > | > | > "This posting is provided "AS IS" with no warranties, and
confers
| no
| > | > | > rights."
| > | > | >
| > | > | > --------------------
| > | > | > | Reply-To: "Gary Brizard" <[email protected]>
| > | > | > | From: "Gary Brizard" <[email protected]>
| > | > | > | Subject: Connection strings
| > | > | > | Date: Tue, 14 Oct 2003 15:42:46 -0700
| > | > | > | Lines: 7
| > | > | > | Organization: Pala Casino
| > | > | > | X-Priority: 3
| > | > | > | X-MSMail-Priority: Normal
| > | > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | > | Message-ID: <[email protected]>
| > | > | > | Newsgroups: microsoft.public.dotnet.languages.vb
| > | > | > | NNTP-Posting-Host: 216.190.36.99
| > | > | > | Path:
| > | > | >
| > | > |
| > | >
| > |
| >
|
cpmsftngxa06.phx.gbl!TK2MSFTNGXA06.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
| > | > | > 8.phx.gbl!tk2msftngp13.phx.gbl
| > | > | > | Xref: cpmsftngxa06.phx.gbl
| > | microsoft.public.dotnet.languages.vb:146738
| > | > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > | > | > |
| > | > | > | 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.
| > | > | > |
| > | > | > |
| > | > | > |
| > | > | >
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|
 

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