471,306 Members | 837 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,306 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 1430
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Chris Dunaway | last post: by
5 posts views Thread by Simon Harvey | last post: by
5 posts views Thread by Guadala Harry | last post: by
3 posts views Thread by Hans Merkl | last post: by

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.