Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 148153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:54:27+00:00 2026-05-11T08:54:27+00:00

I ran across a new problem in the last week. Due to the nature

  • 0

I ran across a new problem in the last week. Due to the nature of my project and available budget a small intranet web application I’ve been working on is both the testing and live server, as well as serves up the pages and is the sql server. This will last at least until the project is out of the major development cycle. Now that the project has real users but I am continuing development I duplicated the database to have a safe copy to mess with that won’t cause havoc to live business data and a development copy of the website.

All was well until I discovered an anomoly on the test copy of the site, anything that uses a sql datasource was properly pulling it’s data from the test database, but anything that gets it’s data from a stored procedure triggered in the code behind was pulling it’s data from the live databse.

My confusion comes from the fact that all stored procedures and sql datasources ultimately point back to the same connectionstring setting in the web.config file to know where to connect to. I just rename the database name depending on if I’m uploading the latest changes to the test or live site.

My question comes down to, why would with one connection string in each site would my test site accessing data one way get it from one database and accessing the other get it’s data from the other database?

Here’s my connection string they all point back to, names/passwords of course change for obvious reasons, but the structure is intact.

<add name='db_Connection' connectionString='Data Source=SERVERNAME;Initial Catalog=DATABASE_live;Persist Security Info=False;User ID=USERID;Password=password' providerName='System.Data.SqlClient'/> 

I added a key to the appsettings to reference the name of the database connection so I could easily change it’s name if need be without having to edit dozens of pages for the code behind SProc calls.

<add key='defaultDB' value='db_Connection' /> 

Am I violating some rule I’m unaware of or is there something else going on that I need to be aware of and change so I can have a true test environment as I continue to develop an active site?

EDIT This project is in ASP.NET 2.0 VB, fixed the code display.

solution found I have tracked down the solution, thanks for the pointers, they got me looking elsewhere. When I copied the site to a different location for testing I forgot to update my appsetting key for the site’s location, this caused the following part of the call for stored procedures to grab data from the live site’s web.config aparently.

System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(pubvar_webConfig) 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T08:54:28+00:00Added an answer on May 11, 2026 at 8:54 am

    I would search all of the files in your solution to make sure you don’t have one of the database names hard coded some place. Maybe in the designer files?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm quite new to C++ and I've ran across a problem. I'm trying to
I'm fairly new on a project and ran across an interesting design paradigm for
I am new to Scala, and ran across a small hiccup that has been
I'm currently working on a medium-sized web project, and I've ran into a problem.
I ran across an unexpected problem with the following code. List<string> items = new
This is a puzzler I ran across this week. It's partly due to the
I am a bit new to reusable plugins for jquery. I have ran across
I ran across a very strange line of code in a legacy Perl application.
I ran across this snippet in an internal web site, but I'm having trouble
I ran across an interesting issue today. We have an application that utilizes Zend

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.