Saturday, July 31, 2010
  Search
 
Register
Login
 
How To Customize the Privacy and Terms Links on Your DotNetNuke Portal
Straight out of the box, DotNetNuke already has a lot of things covered. But, what do you do when you are ready to begin customizing your site. Sometimes, it’s not so easy to figure out how to make t...

Find this article and more in the DotNetNuke category

Read This Article . . .

CodePrint Module
Tired of mucking around with adding code chunks to your website? We all know what a pain it can be trying to add some simple block of code to our webpages and still make it readable. Introducing....T...

Find this article and more in the DotNetNuke category

Read This Article . . .

Creating a Virtual Directory in IIS
One of the first things you will need to do prior to installing DotNetNuke on a server is to create a virtual directory which will host your DotNetNuke website.  If you have full control over you...

Find this article and more in the IIS & ASP.NET category

Read This Article . . .

New "Styles" SkinObject Found in DotNetNuke 4.9
One more addition has been added to the developer's DotNetNuke skinning toolbox with the release of DotNetNuke 4.9. Introducing...the Styles SkinObject. This little object is a very welcome addition ...

Find this article and more in the DotNetNuke category

Read This Article . . .

Customize Your DotNetNuke Installation
Do you ever get tired of installing DotNetNuke just to go and change the same properties over and over? Why not just customize your install and skip the drudgery all together…

Find this article and more in the category

Read This Article . . .

How To Customize the Privacy and Terms Links on Your DotNetNuke Portal
Straight out of the box, DotNetNuke already has a lot of things covered. But, what do you do when you are ready to begin customizing your site. Sometimes, it’s not so easy to figure out how to make t...

Find this article and more in the category

Read This Article . . .

How to Use the DNNLabelEdit Control
 It's easy to use the DNNLabelEdit control, you know the one you mouse over and edit in place? Yeah, that one. In just a few minutes, you can begin using the control on your sites as well for full on...

Find this article and more in the Module Development category

Read This Article . . .

Setting Up the DotNetNuke Side of Multi-Websites
Ok, so by now you know that DotNetNuke can handle multiple websites, but you still want to know why. Well, it’s pretty easy once you know how to do it, but it can be pretty confusing to some who are ...

Find this article and more in the category

Read This Article . . .

Installation from the DotNetNuke Install Package 4.90 to Windows XP Professional
OK, so you made the leap and downloaded an installation package of DotNetNuke 4.x.   But now what do I do?  Well, here's a step-by-step instruction guide to get you up and running with DotNetNuke 4....

Find this article and more in the Localhost category

Read This Article . . .

Using DNN to take Advantage of GoDaddy Domain Names
Let's face it, GoDaddy is cheap. Pay for the hosting services and the domain names are $1.99, not a bad deal. And even without hosting services, you can pick up domain names for as low as $6.99. Put ...

Find this article and more in the category

Read This Article . . .

Search for Articles

Virtual-Essential's DotNetNuke, .NET, and SQL Tips For the Developer

Minimize
Nov 10

Written by: Briana Tarrance
11/10/2008 4:05 PM 

If you happen to use many databases or need to switch between development databases and production, there is a quick way to keep all of your database connections manageable. By moving all of your connection strings into a separate file, you can quickly comment and uncomment them and add as many as you like without cluttering up the web.config file.

Simply create a file named "connectionStrings.config" and place in the root directory of your web application. Then cut and paste all of your connection strings onto this file, to include the beginning and ending tags.

You should have a file that looks like this now: connectionStrings.config

<connectionStrings>



<add name="SiteSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|Database.mdf;"/>

<add name="Database1" connectionString="Data Source=Server1;Database=Important1; User ID=******; pwd=*****;" providerName="System.Data.SqlClient"/>

<add name="Database2" connectionString="Data Source=Server2;Database=Important2; User ID=******; pwd=*****;" providerName="System.Data.SqlClient"/>

<add name="Database3" connectionString="Data Source=Server3;Database=Important3; User ID=******; pwd=*****;" providerName="System.Data.SqlClient"/>

<add name="Database4" connectionString="Data Source=Server4;Database=Important4; User ID=******; pwd=*****;" providerName="System.Data.SqlClient"/>

<add name="Database5" connectionString="Data Source=Server5;IDatabase=Important5; User ID=******; pwd=*****;" providerName="System.Data.SqlClient"/>

connectionStrings> 

Now, modify the Web.config
So, now that you have removed all the connection string information, simply add this back in the same spot on the web.config file:

<connectionStrings configSource="connectionStrings.config"/>

That's it. Now you've got a separate, easy to read file just to hold your connection strings. So go ahead...go nuts...add as many as you need! WooHoo!

Tags:

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment   Cancel 
 
 
Copyright 2008 by Virtual-Essentials.com Privacy Statement    Terms Of Use