473,386 Members | 1,830 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,386 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 2421
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.