Solved

ASP.NET Development SQL Server

Posted on 2011-09-06
4
307 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
zvytas

Thanks for all.  Very informative.

tk
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now