473,399 Members | 2,159 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,399 software developers and data experts.

Connection string in VB.NET

VK
Dear All:

We are in the processing of building a new web site using VB.NET and
SQL2000

I had a question about WHERE to store the connection string for SQL dB -
in an include file or web.config file? What are the pros and cons if
any? We may be connecting to more than one database.

Many thanks.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #1
6 2422
VX,

I store mine in the web.config file (intranet only). Actually I store the
ServerName and DatabaseName in the web.config file. I then pass this
information to another component that builds the connection string
dynamically and then connects and returns the connection object. In limited
circumstances where the connection string might include a username and
password, I store the entire connection string in the web.config file and
pass that directly into the connection component.

Storing connection information in the web.config is really only as secure as
your web server so use accordingly.

"VK" wrote:
Dear All:

We are in the processing of building a new web site using VB.NET and
SQL2000

I had a question about WHERE to store the connection string for SQL dB -
in an include file or web.config file? What are the pros and cons if
any? We may be connecting to more than one database.

Many thanks.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 21 '05 #2
VX,

I store mine in the web.config file (intranet only). Actually I store the
ServerName and DatabaseName in the web.config file. I then pass this
information to another component that builds the connection string
dynamically and then connects and returns the connection object. In limited
circumstances where the connection string might include a username and
password, I store the entire connection string in the web.config file and
pass that directly into the connection component.

Storing connection information in the web.config is really only as secure as
your web server so use accordingly.

"VK" wrote:
Dear All:

We are in the processing of building a new web site using VB.NET and
SQL2000

I had a question about WHERE to store the connection string for SQL dB -
in an include file or web.config file? What are the pros and cons if
any? We may be connecting to more than one database.

Many thanks.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 21 '05 #3
Hi VK,

In addition to Mike's post:
I used to encrypt the connection string (which would have the username and
pwd) and store it in a seperate file, which we decrypt @ run-time. Addition
of new connection strings won't call for a big coding effort.

HTH,
Rakesh Rajan

<VK> wrote in message news:OA**************@TK2MSFTNGP11.phx.gbl...
Dear All:

We are in the processing of building a new web site using VB.NET and
SQL2000

I had a question about WHERE to store the connection string for SQL dB -
in an include file or web.config file? What are the pros and cons if
any? We may be connecting to more than one database.

Many thanks.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 21 '05 #4
Hi VK,

In addition to Mike's post:
I used to encrypt the connection string (which would have the username and
pwd) and store it in a seperate file, which we decrypt @ run-time. Addition
of new connection strings won't call for a big coding effort.

HTH,
Rakesh Rajan

<VK> wrote in message news:OA**************@TK2MSFTNGP11.phx.gbl...
Dear All:

We are in the processing of building a new web site using VB.NET and
SQL2000

I had a question about WHERE to store the connection string for SQL dB -
in an include file or web.config file? What are the pros and cons if
any? We may be connecting to more than one database.

Many thanks.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 21 '05 #5
VK
Hi Rakesh,

Looks like you stored the connection string in a file which you would
include on all .aspx pages - which was encrypted.

like Mike suggested he used the connection string from web.config file
for his "intranet" site. Our web site would be the internet.

Thanks.
Vani

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #6
Thanks for the help.
Vani

"VK" wrote:
Hi Rakesh,

Looks like you stored the connection string in a file which you would
include on all .aspx pages - which was encrypted.

like Mike suggested he used the connection string from web.config file
for his "intranet" site. Our web site would be the internet.

Thanks.
Vani

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 21 '05 #7

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

Similar topics

0
by: iKiLL | last post by:
Hi All Code Below for this problem ERROR: "An existing connection was forcibly closed by the remote host"
6
Cintury
by: Cintury | last post by:
Hi all, I've developed a mobile application for windows mobile 5.0 that has been in use for a while (1 year and a couple of months). It was developed in visual studios 2005 with a back-end sql...
3
by: ninjamonkey | last post by:
Hi all, I've developed a mobile application for windows mobile 5.0 that has been in use for a while (1 year and a couple of months). It was developed in visual studios 2005 with a back-end sql...
0
by: Robert Avery | last post by:
In VBA/VB6, I had a class (incomplete sample below) that watched and displayed for the user all connection events, so that I could easily see what SQL was taking a long time, and when it freezes, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.