473,372 Members | 1,034 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,372 software developers and data experts.

Where to store DB connection string?

Hello, friends,

I have two questions:

(1) In asp.net, where is the best place to store DB connection string? (We
have .dll to handle all DB queries.)

(2) Any sample source code for client side calendar? (We tried web control
calendar. But, each time we selected a date/changed year or month, it would
go back to web server. It would increase a lot network traffic.)

Thanks a lot.

Nov 19 '05 #1
4 1551
Andrew,

The best practices state to store the connection string in the appSettings
section of the web.config file.

I don't have a recommendation for a calendar, I hope someone else will be
able to steer you in the right direction for that.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Andrew" <An****@discussions.microsoft.com> wrote in message
news:87**********************************@microsof t.com...
Hello, friends,

I have two questions:

(1) In asp.net, where is the best place to store DB connection string? (We
have .dll to handle all DB queries.)

(2) Any sample source code for client side calendar? (We tried web control
calendar. But, each time we selected a date/changed year or month, it
would
go back to web server. It would increase a lot network traffic.)

Thanks a lot.

Nov 19 '05 #2
1) web.config
2) look at www.asp.net in the control galleries. Lots of calendars there.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Andrew" wrote:
Hello, friends,

I have two questions:

(1) In asp.net, where is the best place to store DB connection string? (We
have .dll to handle all DB queries.)

(2) Any sample source code for client side calendar? (We tried web control
calendar. But, each time we selected a date/changed year or month, it would
go back to web server. It would increase a lot network traffic.)

Thanks a lot.

Nov 19 '05 #3
try the www.componentart.com suite. There is a calender included.

On Tue, 11 Oct 2005 07:00:12 -0700, Andrew
<An****@discussions.microsoft.com> wrote:
Hello, friends,

I have two questions:

(1) In asp.net, where is the best place to store DB connection string? (We
have .dll to handle all DB queries.)

(2) Any sample source code for client side calendar? (We tried web control
calendar. But, each time we selected a date/changed year or month, it would
go back to web server. It would increase a lot network traffic.)

Thanks a lot.

Nov 19 '05 #4
Hello Dear Andrew,

Answer to your 1st Question
(1) In asp.net, where is the best place to store DB connection string? (We
have .dll to handle all DB queries.)
In the web.config just add the <appSettings></appSettings> in between
<configuration> and <system.web> like the following
<configuration>
<appSettings>

<add key="ConnectionInfo"
value="server=(local);database=Northwind;Integrate d Security=SSPI" />

</appSettings>
<system.web>

give a Key Name for example I have given it as "ConnectionInfo" and the
value as your database details.

Thats all in the web.config.

In you code-behind file, to retrieve the Connection Info use
ConfigurationSettings.AppSettings

for example:

string connectionInfo = ConfigurationSettings.AppSettings["ConnectionInfo"];

using(SqlConnection connection = new SqlConnection(connectionInfo))

Try this one, It will work.

Reply to the 2nd Question, I will come back to you
(2) Any sample source code for client side calendar? (We tried web control
calendar. But, each time we selected a date/changed year or month, it would
go back to web server. It would increase a lot network traffic.)


bye
venkat_kl
Nov 19 '05 #5

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

Similar topics

2
by: Chris Dunaway | last post by:
I have a web service that references a data class library which performs SQL Server access. Since the web service is also a class library, there is no App.Config, only Web.config. Is Web.Config...
5
by: Simon Harvey | last post by:
Hi everyone, As I understand it, storing an applications SQL Server connection string in the web.config file is a security risk. I'm wondering then, what the simplest solution is to this...
5
by: Guadala Harry | last post by:
What are my options for *securely* storing/retrieving the ID and password used by an ASP.NET application for accessing a SQL Server (using SQL Server authentication)? Please note that this ID and...
8
by: Charlie | last post by:
Hi: My ASP.NET app opens and closes database connection in several pages. Rather than hard coding string into every page, is there a place I can put it where all pages will be able to access it....
6
by: ad | last post by:
We usually store the connection string of Web Applicaiton in Web.Config. Now I want to develop WinForm Application. Where is the better place to store the conneciton string?
3
by: Hans Merkl | last post by:
Hi, I am helping to build a web app that's pretty much a wrapper around a web service. The question now is how to store the handle of the web service object between requests. My client is using...
1
by: GS | last post by:
I have system wide connection string defined in web.config. Is it possible to store connection object in global variable accessible by whole application and get reference to it in different parts of...
5
by: Darrel | last post by:
I've been taught that, at least in 1.1, you put your DB connection strings in the WebConfig file and access them from there as needed. In 2.0, it looks like I can do the same, but it's been...
8
by: Merk | last post by:
I'm looking for a safe and maintainable way to store connection string info (connecting to SQL Server 2005 from .NET 2.0 Windows Forms client app); things like server name or IP address and...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.