Solved

ASP.NET Development SQL Server

Posted on 2011-09-06
4
312 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

739 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