Solved

ASP.NET Development SQL Server

Posted on 2011-09-06
4
310 Views
Last Modified: 2012-05-12
Experts:

What's a decent, simple way to reference a separate SQL server when developing, so that none of my testing hits the production server?  I do all my own design, development and testing on my own.  I already have a separate SQL server I can use.

I'm envisioning making a "clone" of all my databases on the soon-to-be development server, and then having to manually tweak connectionstrings in web.config every time I release.  What's the proper way to do this?
0
Comment
Question by:tknudsen-qec
  • 2
  • 2
4 Comments
 
LVL 5

Expert Comment

by:zvytas
ID: 36489393
I used to use custom DNS for this. Your connection string would look something like this:

"...;Server=SQLServer;..."

You than create custom DNS entries - on your development machine it will point to the DEV SQL server. On Production server it will point to Production SQL server.

In this case you don't need to worry about changing connections strings at all.

Hope that helps.
0
 
LVL 3

Author Comment

by:tknudsen-qec
ID: 36489467
That's certainly worth an accepted or assisted solution.  Ideally I'd have an alternative to bounce off the boss in case this notion doesn't stick.  If I understand correctly, we'd have to remember to set up the DNS any time we migrated/rebuilt/whatevered the production or development machine.

Is this the commonly held practice?  Is there another common method?

I was thinking maybe when I switch my application from DEBUG to RELEASE it could use a separate list of connection strings.  Is this possible/normal/intelligent?
0
 
LVL 5

Accepted Solution

by:
zvytas earned 500 total points
ID: 36489620
Yes, your understanding is correct - DNS setup would have to be done every time code is migrated.

Another commonly used option is web.config transformation. You can find more info about this here:

http://blogs.msdn.com/b/webdevtools/archive/2010/10/26/asp-net-web-projects-web-debug-config-amp-web-release-config.aspx
http://drdobbs.com/visualstudio/224201017

Yet another widely used option is modifying config files in the build process, however you need CI environment for that (CruiseControl, TeamCity or similar).
0
 
LVL 3

Author Closing Comment

by:tknudsen-qec
ID: 36489738
zvytas

Thanks for all.  Very informative.

tk
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question